dumpyourvms: add condition for switching off 2nd GPU

This commit is contained in:
teutat3s 2023-07-02 02:50:51 +02:00
parent 9909a2152b
commit 1586111aeb
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -91,7 +91,7 @@ in {
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.bash}/bin/sh -c 'sleep 7 && echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch'";
ExecStart = "${pkgs.bash}/bin/sh -c 'sleep 7 && if grep --quiet 'IGD:+' /sys/kernel/debug/vgaswitcheroo/switch; then echo -e \"IGD\\nOFF\" > /sys/kernel/debug/vgaswitcheroo/switch; fi'";
ExecStop = "${pkgs.bash}/bin/sh -c 'echo ON >/sys/kernel/debug/vgaswitcheroo/switch'";
};
wantedBy = ["multi-user.target"];