From 45c927e2d94a51efb783b9b6c51011dc524e25cb Mon Sep 17 00:00:00 2001 From: klever1988 <56048681+klever1988@users.noreply.github.com> Date: Fri, 27 Mar 2020 21:09:32 +0800 Subject: [PATCH] Update check_wan4.sh --- scripts/check_wan4.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/check_wan4.sh b/scripts/check_wan4.sh index afc89ad..e7fd719 100755 --- a/scripts/check_wan4.sh +++ b/scripts/check_wan4.sh @@ -1,13 +1,10 @@ #!/bin/sh while true; do - source /lib/functions/network.sh - network_find_wan NET_IF - network_get_gateway NET_GW "${NET_IF}" - - r=`ping -c1 "${NET_GW}" 2>&1` + wan=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` + r=`ping -c1 $wan 2>&1` case $r in - *permitted* ) /etc/init.d/firewall restart ;; + *permitted* ) /etc/init.d/firewall reload ;; esac sleep 2 done