#!/bin/sh # Set your account information of VALUE-DOMAIN.com vdomain=`echo 'hogehoge.com'`; vpass=`echo 'password'`; # WAN port wan_if=`echo 'ppp0'`; # Getting the current directory of this script current_dir=`echo $(cd $(dirname $0);pwd)` # Get older ip address oldip=`cat $current_dir/getip`; # Get current ip address `ifconfig $wan_if | grep "inet addr" | awk '{print $2}' | sed 's@addr:@@'` > $current_dir/getip; # You can also use this line; # wget -O $current_dir/getip "http://dyn.value-domain.com/cgi-bin/dyn.fcg?ip"; sleep 5; newip=`cat $current_dir/getip`; # Renew (or do not renew) if [ "$oldip" != "$newip" ]; then wget -O $current_dir/getip_status "http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=$vdomain&p=$vpass&h=*&i=$newip"; echo "`date` $oldip -> $newip" >> $current_dir/log; fi