#!/bin/sh [ -z "$address" ] && exit 0 # on 'down' $address will undefined logger -t white_ip[$$] "interface: " $interface ", address: " $address if [ "$interface" = "ppp0" ]; then # check interface name _ip=$(echo $address | grep -v "^100\." | grep -v "^10\.") # is address no related to 100.x.y.z or 10.x.y.z subnetwork? # re-initialize wan and write to syslog if [ -z "$_ip" ]; then logger -t white_ip[$$] "Reloading wan due grey IP - $address"; ndmq -p 'interface PPPoE0 no dyndns profile _WEBADMIN' -P message ndmq -p 'interface PPPoE0 no connect via ISP' -P message sleep 2 ndmq -p 'interface PPPoE0 connect via ISP' -P message else logger -t white_ip[$$] "White IP - $address"; ndmq -p 'interface PPPoE0 dyndns profile _WEBADMIN' -P message #sleep 1 #ndmq -p 'interface PPPoE0 dyndns update force' -P message fi fi logger -t white_ip[$$] "Finished"