編寫:/root/wan-watchdog.sh
#!/bin/sh
tries=0
while [[ $tries -lt 5 ]]
do
if /bin/ping -c 1 100.64.6.1 >/dev/null
then
exit 0
fi
tries=$((tries+1))
/etc/init.d/network restart
exit 0
done
exit 0
之後到 System → Scheduled Tasks 加入:
* * * * * /root/wan-watchdog.sh
參考資料:
OpenWrt WAN watchdog (2013)
本文来自投稿,不代表本站立场,如若转载,请注明出处: