Created
June 25, 2021 07:44
-
-
Save akira-kuriyama/78693798f0c7cdc8ae6719555ebcbc12 to your computer and use it in GitHub Desktop.
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 | |
WIFI_NAME=my-wifi-name | |
while true | |
do | |
if [[ -n `networksetup -getairportnetwork en0 | grep $WIFI_NAME` ]]; then | |
sleep 30 | |
continue | |
fi | |
if [[ -n `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s | grep $WIFI_NAME` ]]; then | |
networksetup -setnetworkserviceenabled Wi-Fi off | |
networksetup -setnetworkserviceenabled Wi-Fi on | |
sleep 10 | |
fi | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment