Feb
20
2017
Reboot OpenWRT
from: http://www.geekslove.it/2014/04/rebooting-openwrt-automatically-when.html
#! /bin/sh
# Checks if the wifi conn is up. If not, it tries to restart
# the wifi. If that fails, then reboot.
if ping -c 1 10.200.10.1 > /dev/null
then
echo nothing > /dev/null
else
/etc/init.d/network restart
sleep 30
if ping -c 10.200.10.1 > /dev/null
then
echo nothing > /dev/null
else
date >> /root/reboot.log
reboot
fi
fi
# Checks if the wifi conn is up. If not, it tries to restart
# the wifi. If that fails, then reboot.
if ping -c 1 10.200.10.1 > /dev/null
then
echo nothing > /dev/null
else
/etc/init.d/network restart
sleep 30
if ping -c 10.200.10.1 > /dev/null
then
echo nothing > /dev/null
else
date >> /root/reboot.log
reboot
fi
fi