I've been making a bash script that involves checking if it can ping. I swear it was working before, but now it throws On or Off depending on if I commend or uncomment the first line here.
The purpose of the while loop is to keep looping until it can successfully ping.
Code:#Internet=0 while [ ! $Internet ] do ping -c 1 -w 3 google.com if [ $? -ne ] ; then $Internet = 0 echo Off else $Internet = 1 echo On fi #More code. done
Bookmarks