andresmorago
Senior Member
Hello
Im trying to configure @Martineau Chk-WAN script. My desired behavior is to run the script every 10 minutes and to restart WAN when connection fails.
According to the wiki, I should use this cron script but i notice that the
Im trying to configure @Martineau Chk-WAN script. My desired behavior is to run the script every 10 minutes and to restart WAN when connection fails.
According to the wiki, I should use this cron script but i notice that the
cron
flag with reboot router instead of just the wan connection.
Code:
cat > /jffs/scripts/wan-event << EOF;chmod +x /jffs/scripts/wan-event
#!/bin/sh
if [ "\$2" == "connected" ];then
sh /jffs/scripts/ChkWAN.sh ping=1.1.1.1,8.8.8.8 cron="\*/10 \* \* \* \*" &
fi
EOF
Code:
# ChkWAN cron
# Will REBOOT router if the PINGs to ALL of the hosts FAILS, cron entry is added: Runs every 30mins.
# 'cru a ChkWAN "*/30 * * * * /jffs/scripts/ChkWAN.sh"'
#
# ChkWAN cron=\*/5
# Will REBOOT router if the PINGs to ALL of the hosts FAILS, cron entry is added: Runs every 5mins.
# 'cru a ChkWAN "*/5 * * * * /jffs/scripts/ChkWAN.sh"'
# NOTE: You need to escape the '*' on the commandline :-(