prepare-suspend 521 B

12345678910111213141516
  1. #!/bin/sh
  2. action=$1
  3. [ -z "$action" ] && action=suspend
  4. if [ x"$action" == x"suspend" ]; then
  5. nmcli nm sleep true || service NetworkManager stop
  6. # Force interfaces down, just in case when NM didn't done it
  7. for if in `ls /sys/class/net|grep -v "lo\|vif"`; do
  8. ip l s $if down
  9. done
  10. modprobe -r uhci_hcd ehci_hcd
  11. else
  12. modprobe ehci_hcd; modprobe uhci_hcd;
  13. nmcli nm sleep false || { [ -x /bin/systemctl ] && systemctl start NetworkManager.service; } || service qubes-core-netvm start
  14. fi