2012-07-13 14:40:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
action=$1
|
|
|
|
[ -z "$action" ] && action=suspend
|
|
|
|
|
|
|
|
if [ x"$action" == x"suspend" ]; then
|
|
|
|
nmcli nm sleep true || service NetworkManager stop
|
|
|
|
# Force interfaces down, just in case when NM didn't done it
|
|
|
|
for if in `ls /sys/class/net|grep -v "lo\|vif"`; do
|
|
|
|
ip l s $if down
|
|
|
|
done
|
2013-10-22 16:51:38 +02:00
|
|
|
modprobe -r uhci_hcd ehci_pci ehci_hcd
|
2013-07-19 03:40:06 +02:00
|
|
|
lsmod|grep -q iwldvm && touch /var/run/qubes/suspend-iwldvm-loaded
|
|
|
|
modprobe -r iwldvm
|
2012-07-13 14:40:52 +02:00
|
|
|
else
|
2013-07-19 03:40:06 +02:00
|
|
|
modprobe ehci_pci; modprobe uhci_hcd
|
|
|
|
test -e /var/run/qubes/suspend-iwldvm-loaded && modprobe iwldvm
|
2013-03-13 02:26:40 +01:00
|
|
|
nmcli nm sleep false || { [ -x /bin/systemctl ] && systemctl start NetworkManager.service; } || service qubes-core-netvm start
|
2012-07-13 14:40:52 +02:00
|
|
|
fi
|