Last active
August 12, 2016 10:20
-
-
Save digiltd/e8b2f2cc0476c122c151777150300f59 to your computer and use it in GitHub Desktop.
Ping Google up to five times to test internet connectivity
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
# Source : http://stackoverflow.com/questions/13224718/check-for-active-internet-connection-with-applescript-automator | |
repeat with i from 1 to 5 | |
try | |
do shell script "ping -o -t 5 www.google.com" | |
exit repeat | |
on error | |
delay 20 | |
if i = 5 then error number -128 | |
end try | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment