1
1
Fork 0

remote.sh: avoid suspending shutdown

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-11-17 17:27:29 -06:00
parent dd791f454e
commit bcec932005
Signed by: myned
GPG key ID: C7224454F7881A34

View file

@ -68,6 +68,11 @@ fi
# Suspend VM after connection ends
if [[ "${argc_vm:-}" ]]; then
virsh suspend "${argc_host:-}"
notify-send "> remote" "${argc_host:-} paused" --urgency low
# Delay to avoid suspending shutdown
sleep 5
if [[ "$(virsh domstate "${argc_host:-}")" != "shut off" ]]; then
virsh suspend "${argc_host:-}"
notify-send "> remote" "${argc_host:-} paused" --urgency low
fi
fi