xip=`/usr/bin/wget -q --read-timeout=15.0 --waitretry=5 --tries=3 http://checkip.dyndns.org -O - | /usr/bin/cut -f2 -d: | /usr/bin/cut -f1 -d"<" | /usr/bin/sed "s/\ //g"`
/usr/bin/echo $xip | /usr/bin/egrep -q [0-9,\.] && {
/usr/bin/echo /usr/bin/egrep -q $xip$ /local/etc/wanip.txt
/usr/bin/echo -n "grep response: "
/usr/bin/egrep $xip$ /local/etc/wanip.txt
/usr/bin/egrep -q $xip$ /local/etc/wanip.txt || {
/usr/bin/wall $HOSTNAME wan IP changes $xip
/usr/local/etc/pushovermsg $HOSTNAME wan IP changes $xip
}
/usr/bin/echo $xip > /local/etc/wanip.txt
} || {
/usr/bin/echo IP found was: $xip
/usr/bin/echo no ip acquired
}
No comments:
Post a Comment