Skip to content

Instantly share code, notes, and snippets.

@hpiedcoq
Created July 22, 2019 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hpiedcoq/faf09da6dd71a1a77a7672b8a56d1bd1 to your computer and use it in GitHub Desktop.
Save hpiedcoq/faf09da6dd71a1a77a7672b8a56d1bd1 to your computer and use it in GitHub Desktop.
R - test if internet is up - If not loop and retest
#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