Created
January 24, 2009 10:10
-
-
Save igal/51396 to your computer and use it in GitHub Desktop.
Reload Intel 4965 wireless network drivers on Ubuntu 8.04
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 | |
# Reload Intel 4965 wireless network drivers on Ubuntu 8.04 | |
set -x | |
sudo ruby -e ' | |
begin | |
system "pkill -9 knetworkmanager" | |
mods = %w(iwl4965 iwlwifi_mac80211 cfg80211) | |
mods.each{|mod| system "rmmod #{mod}"} | |
mods.each{|mod| system "modprobe #{mod}"} | |
rescue Exception => e | |
p e | |
end | |
' | |
if [[ root = $LOGNAME ]]; then | |
if [ -n $SUDO_USER ]; then | |
su $SUDO_USER -c "knetworkmanager &" | |
else | |
echo "ERROR: You must run this as a non-root user or through a sudo session" | |
fi | |
else | |
knetworkmanager & | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment