remote.sh: avoid suspending shutdown
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
dd791f454e
commit
bcec932005
1 changed files with 7 additions and 2 deletions
|
@ -68,6 +68,11 @@ fi
|
||||||
|
|
||||||
# Suspend VM after connection ends
|
# Suspend VM after connection ends
|
||||||
if [[ "${argc_vm:-}" ]]; then
|
if [[ "${argc_vm:-}" ]]; then
|
||||||
virsh suspend "${argc_host:-}"
|
# Delay to avoid suspending shutdown
|
||||||
notify-send "> remote" "${argc_host:-} paused" --urgency low
|
sleep 5
|
||||||
|
|
||||||
|
if [[ "$(virsh domstate "${argc_host:-}")" != "shut off" ]]; then
|
||||||
|
virsh suspend "${argc_host:-}"
|
||||||
|
notify-send "> remote" "${argc_host:-} paused" --urgency low
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue