Skip to content

Instantly share code, notes, and snippets.

@ikuwow
Created February 3, 2018 04:02
Show Gist options
  • Save ikuwow/49c3dba8dc3608d52e269b89d1bb4181 to your computer and use it in GitHub Desktop.
Save ikuwow/49c3dba8dc3608d52e269b89d1bb4181 to your computer and use it in GitHub Desktop.
カッフェーでWiFiが突然繋がらなくなったときに打つコマンド ref: https://qiita.com/ikuwow/items/fd67c2cff0d6ec976bdb
# 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.'
}
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --help
networksetup -help
$ 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