i want a script that
"on the beginning of the program it pings to check if there is internet connectivity.
if there is internet connectivity
then it executes my code
else if there is no internet it waits at background to detected internet connectivity then executes my code."
Is this possible