core-admin/dom0/pm-utils/01qubes-suspend-netvm
2011-03-29 12:22:31 +02:00

33 lines
757 B
Bash
Executable File

#!/bin/sh
. "${PM_FUNCTIONS}"
suspend_net()
{
NETVM=$(qvm-get-default-netvm)
if [ "X"$NETVM = "X""dom0" -o "X"$NETVM = "X" -o "X"$NETVM = "X""none"] ; then
exit 0
fi
qvm-run -u root --pass_io $NETVM "source /usr/lib64/pm-utils/pm-functions; run_hooks sleep suspend suspend"
# Ignore exit status from netvm...
return 0
}
resume_net()
{
NETVM=$(qvm-get-default-netvm)
if [ "X"$NETVM = "X""dom0" -o "X"$NETVM = "X" -o "X"$NETVM = "X""none"] ; then
exit 0
fi
qvm-run -u root --pass_io $NETVM "source /usr/lib64/pm-utils/pm-functions; run_hooks sleep resume suspend reverse"
# Ignore exit status from netvm...
return 0
}
case "$1" in
resume) resume_net ;;
suspend) suspend_net ;;
*) exit 0 ;;
esac