If a pi boots into hotspot mode before connecting to a known good SSID, the gateway list download will fail if it is run at boot from cron. To avoid this, we need to add a check for internet when the getardoplist-cron script is called. This code should work at the beginning of the script:
#check for internet before attempting to download the list
internet=1 #set the test to false
while [ "$internet" = 1 ]; do
echo "check for internet connection"
ping -c 5 8.8.8.8
internet=$?
sleep 60 #wait one minute before trying again
done
echo "Internet connection detected"
If no connection is detected, the script will retry every 60 seconds.
If a pi boots into hotspot mode before connecting to a known good SSID, the gateway list download will fail if it is run at boot from cron. To avoid this, we need to add a check for internet when the getardoplist-cron script is called. This code should work at the beginning of the script:
If no connection is detected, the script will retry every 60 seconds.