#! /bin/sh # # exec by root # PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin export PATH # basedir=/provider/catv # device=eth0 interval=5m # oldip="0.0.0.0" # while [ x = x ] do newip=`ifconfig ${device} |\ grep 'inet addr:' |\ sed -e 's/^.*inet addr://' -e 's/ .*$//'` # if [ "X${oldip}" != "X${newip}" ] then # myh.no-ip.org noip -c ${basedir}/etc/no-ip.conf oldip=${newip} fi sleep ${interval} done