Files
nanopi-openwrt-r1s-h3/scripts/check_wan.sh
2020-03-24 16:32:20 +08:00

15 lines
268 B
Bash

#!/bin/sh
source /lib/functions/network.sh
network_find_wan NET_IF
network_get_gateway NET_GW "${NET_IF}"
r=`ping -c1 "${NET_GW}"`
r=`echo $r | grep Permitted`
while true; do
if [[ "$r" != "" ]] ;then
/etc/init.d/firewall restart
fi
sleep 2
done