I need this because some times, two or three times a week, my router gets disconected from the internet and needs a reboot to reconect.
I could write a script and put it in a cron job to execute every 10min, but the problem is that I cannot find a way to store anything in the filesystem because it is readonly.
This is the script I would like to execute:
Code: Select all
#!/bin/bash
/usr/bin/wget -q -s T 20 http://google.com
if [[ $? -eq 0 ]]; then
echo "Online"
else
echo "Offline"
/sbin/reboot
fi