I've followed istructions found on Run Script on Wakeup? to do the following:
I have a ASUS Zenbook and since I upgraded to 16.04
, the wifi stays disconnected on resume. I wrote a script that I can execute manually after wakeup (and entering the root pewd) and it properly hooks my wifi adapter up to my network. The script looks like:
$ cat wifi-resume.sh
systemctl restart network-manager.service
so, following the instructions I created a script in /usr/lib/pm-utils/sleep.d/
called 96wifi-resume
which looks like:
# cat 96wifi-resume
#!/bin/sh
# On my ASUS Zenbook, this script is used to restart the wifi on resume.
# Date 11/04/2016 Ron Eggler
[ -f /bin/systemctl ] || exit $NA
case "$1" in
hibernate|suspend)
exit $NA
;;
thaw|resume)
systemctl restart network-manager.service
;;
*) exit $NA
;;
esac
permissions are set to -rwxr-xr-x 1 root root
but it still does not seem to work, why not, what am I doing wrong here?
edit 1
However, I have replaced all the exit $NA
s with exit 0
and it still doesn't seem to work correctly, however, when I call :/usr/lib/pm-utils/sleep.d# ./96wifi-resume resume
from the shell, it seems to work as expected
$NA
expand to? – waltinator Nov 05 '16 at 17:43/usr/lib/pm-utils/sleep.d/95led
as recommended on http://askubuntu.com/questions/226278/run-script-on-wakeup .echo $NA
doesn't give me nothing. It shouldn't hurt though, would it? – stdcerr Nov 05 '16 at 22:50