Skip to content

Instantly share code, notes, and snippets.

@cab404
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cab404/c07e00114b53b71072c6 to your computer and use it in GitHub Desktop.
Save cab404/c07e00114b53b71072c6 to your computer and use it in GitHub Desktop.
#!/bin/sh
# This script gets NetworkManager out of suspend.
case "$1" in
resume|thaw)
nmcli radio wifi off
nmcli radio wifi on
;;
esac
echo "Getting upstart script"
sudo wget -q https://gist.githubusercontent.com/cab404/c07e00114b53b71072c6/raw/10_network_restart
sudo mv 10_network_restart /etc/pm/sleep.d/
echo "Hooking upstart script to systemd"
sudo wget -q https://gist.githubusercontent.com/cab404/c07e00114b53b71072c6/raw/root-resume.service
sudo mv root-resume.service /etc/systemd/system/
echo "Setting permissions"
sudo chmod 755 /etc/pm/sleep.d/10_network_restart
sudo systemctl enable root-resume.service
[Unit]
Description=Local system resume actions
After=suspend.target
[Service]
Type=simple
ExecStart=/bin/bash /etc/pm/sleep.d/10_network_restart resume
[Install]
WantedBy=suspend.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment