connected event is for the public ISP address, versus no address or the cable modem temporary address while the modem initializes. You could check similarly for realip if you know what it shouldn’t be (empty or private).# cat wan-event
#!/bin/sh
WANUNIT="$1"
WANIP="$(nvram get wan${WANUNIT}_ipaddr)"
STATE="$2"
if [ "$STATE" = "connected" ] && [ ! -f /tmp/adblock/blocklist.gz ]; then
case $WANIP in
0.0.0.0|192.168.100.*) ;;
*) /jffs/addons/adblock/adblock.sh update & ;;
esac
fi
local tries
tries=0
until [ "$(nvram get link_internet)" = "2" ] || [ "${tries}" -ge "6" ]; do
logmsg "Waiting for internet connection..."
sleep 5
tries=$(( tries + 1 ))
done
[ "${tries}" -eq "0" ] || logmsg "Internet connected!"
We use essential cookies to make this site work, and optional cookies to enhance your experience.