Last active
October 29, 2016 10:08
-
-
Save takahirom/93d2e60cfdc2cedb74c854658a99c173 to your computer and use it in GitHub Desktop.
WiFi Auto reconnecting
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
repeat | |
try | |
do shell script "ping -c 5 google.com" | |
on error | |
do shell script "networksetup -setairportpower en0 off" | |
do shell script "networksetup -setairportpower en0 on" | |
display notification "reconnecting" | |
delay 40 | |
try | |
do shell script "ping -c 5 google.com" | |
on error | |
display dialog "You are not connected to the internet" | |
end try | |
end try | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment