I have the following script added to my rc.local file
#wait until the internet connection is ready
wget -q --tries=10 --timeout=20 -O - http://google.com > /dev/null
while [ $? -ne 0 ]; do
printf "Waiting for internet connection"
sleep 10;
wget -q --tries=10 --timeout=20 -O - http://google.com > /dev/null;
done
If I am connected to internet everything just works fine but if I am offline I get error
[FAIL] startpar: service(s) returned failure: rc.local ... failed!
What is wrong here and how could I fix it, I want rc.local to wait for internet connection before it continues to another script