Last active
August 29, 2015 14:20
-
-
Save cab404/c07e00114b53b71072c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script gets NetworkManager out of suspend. | |
case "$1" in | |
resume|thaw) | |
nmcli radio wifi off | |
nmcli radio wifi on | |
;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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