1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| USER="yourname" PASS="123456678" DOMAIN="yafengabc.vicp.net"
URL="http://${USER}:${PASS}@ddns.oray.com:80/ph/update?hostname=${DOMAIN}"
if [ -f /tmp/ddns ]; then ipstr=`curl http://ddns.oray.com/checkip` current_ip=`echo $ipstr|grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'` req=`cat /tmp/ddns| grep "${current_ip}"` if [ ! -z "${req}" ]; then old_ip=`echo ${req}| awk '{ print $2}'` if [ "${old_ip}" = "${current_ip}" ]; then exit fi fi fi wget -q -O /tmp/ddns -q ${URL}
|