Created
February 3, 2018 04:02
-
-
Save ikuwow/49c3dba8dc3608d52e269b89d1bb4181 to your computer and use it in GitHub Desktop.
カッフェーでWiFiが突然繋がらなくなったときに打つコマンド ref: https://qiita.com/ikuwow/items/fd67c2cff0d6ec976bdb
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
# ssidを取得するコマンド | |
alias ssid=$'/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk \'/ SSID/ {print substr($0, index($0, $2))}\'' | |
wifireset () | |
{ | |
ssid=$(ssid) | |
networksetup -setairportpower en0 off | |
echo 'Re-enabling Wi-Fi...' | |
networksetup -setairportpower en0 on | |
echo "Reconnecting ${ssid}..." | |
networksetup -setairportnetwork en0 "$ssid" | |
echo 'Done.' | |
} |
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
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --help |
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
networksetup -help |
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
$ wifireset | |
Re-enabling Wi-Fi... | |
Reconnecting tullys_Wi-Fi... | |
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment