Skip to content

Instantly share code, notes, and snippets.

@cab404 cab404/10_network_restart
Last active Aug 29, 2015

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.