Created
January 4, 2017 22:04
-
-
Save drewsberry/15c698dd53db57ad81c9a2b8b3f294fd to your computer and use it in GitHub Desktop.
Fix WiFi problems that sometimes happen on Ubuntu.
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/bash | |
if [[ $UID -ne 0 ]]; then | |
sudo "$0" | |
exit | |
fi | |
echo "Stopping network manager..." | |
service network-manager stop | |
echo "Done." | |
echo | |
echo "Killing wpa_supplicant..." | |
killall wpa_supplicant | |
echo "Done." | |
echo | |
echo "Restarting network manager application..." | |
nmcli nm wifi off | |
nmcli nm wifi on | |
echo "Done." | |
echo | |
echo "Purging network manager state..." | |
rm /var/lib/NetworkManager/NetworkManager.state | |
echo "Done." | |
echo | |
echo "Starting network manager..." | |
service network-manager start | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment