I use Ubuntu (Trusty and Xenial) and usually sleep rather than power down my computer. A common problem is that on wake the network manager is down so one has to restart the service. E.g. sudo service network-manager restart I am tired of doing this so I have hacked this together: #!/bin/sh # should live in /lib/systemd/system-sleep/... # sudo mv restart-network-on-wake.sh /lib/systemd/system-sleep/ # sudo chmod a+x /lib/systemd/system-sleep/restart-network-on-wake.sh case $1/$2 in pre/*) echo "Going to $2..." exit 0 ;; post/*) echo "Waking up from $2..." if ! ping -q -c 1 -W 1 8.8.8.8 > /dev/null; then echo "IPv4 is down, restarting network-manager" service network-manager restart fi ;; esac I am a novice at shell scripting I guess and don't have a strong understanding of Linux internals, thoughts?