Skip to content

Instantly share code, notes, and snippets.

@gayanhewa
Created October 15, 2014 02:58
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 gayanhewa/04b39f7122285c09d6f2 to your computer and use it in GitHub Desktop.
Save gayanhewa/04b39f7122285c09d6f2 to your computer and use it in GitHub Desktop.
Reload wireless on resume - systemd
[Unit]
Description=Restart WiFi on Resume
After=suspend.target
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/modprobe -r rtl8821ae
ExecStart=/usr/bin/modprobe rtl8821ae
ExecStart=/usr/bin/ifconfig wlp3s0 down
ExecStart=/usr/bin/systemctl restart netctl
ExecStart=/usr/bin/systemctl -f disable netctl@home
ExecStart=/usr/bin/systemctl -f enable netctl@home
ExecStart=/usr/bin/systemctl start netctl@home
[Install]
WantedBy=suspend.target
@gayanhewa
Copy link
Author

netctl@home refers to my wifi profile setup in netctl.

@gayanhewa
Copy link
Author

This doesn't work with the netctl-auto connect yet. But its also possible to reuse the same service to on startup to kick off wireless connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment