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