Created
July 22, 2019 08:31
-
-
Save hpiedcoq/faf09da6dd71a1a77a7672b8a56d1bd1 to your computer and use it in GitHub Desktop.
R - test if internet is up - If not loop and retest
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
#Create the function that tests the DNS of qwant | |
testCon = function(){!is.null(curl::nslookup('qwant.com', error= FALSE))} | |
#Insert this in the script : | |
while(!testCon()){ | |
print('Internet is Down, let's pause 5 seconds and retest before keeping on') | |
Sys.sleep(5) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment