if的shell脚本判断
https://blog.csdn.net/zhan570556752/article/details/80399154
cgi系统命令与配置
https://openwrt.org/zh/docs/guide-user/base-system/uci
https://blog.csdn.net/qq_35718410/article/details/53113894
https://blog.csdn.net/sdvch/article/details/16368655
js获取单选框值
https://blog.csdn.net/qq_21041889/article/details/82223066
网络配置
https://oldwiki.archive.openwrt.org/doc/uci/network
用于在网络不通畅时重启系统
touch /etc/crontabs/root
crontab -e
添加:任务
*/5 * * * * sh /ect/vpn.d/check_network.sh
crontab -l
查看:任务
添加脚本
cd
vi check_network.sh
写入
#!/bin/sh
tries=0
echo --- my_watchdog start ---
while [[ $tries -lt 5 ]]
do
if /bin/ping -c 1 8.8.8.8 >/dev/null
then
echo --- exit ---
exit 0
fi
tries=$((tries+1))
sleep 300
done
/sbin/reboot
然后:
chmod 0755 check_network.sh
ps | grep crontab
查看是否启动
如果未启动:
则:
vi /etc/init.d/rcS
添加:
/etc/init.d/cron enable
/etc/init.d/cron start
手动检测和执行
然后reboot测试