検討!目論見検討委員会

最近はコミケの締切情報メイン

DDNSを更新するシェリルスクリプト

書いてみた。ieServerとvalue-domainが混ざっているところは、是非、突っ込まないで欲しい。

#!/bin/bash
wget -O current_ip http://ipcheck.ieserver.net/index.shtml
CIP=`cat current_ip`

if [ ! -e ./old_ip ]; then
       touch old_ip
       OIP="192.168.0.1"
else
       OIP=`cat old_ip`
       echo $OIP
fi

if [ $OIP != $CIP ]; then
       wget -O ipresult http://dyn.value-domain.com/dyn.fcgi?d=example.jp\&h=\&p=password\&i=$CIP
       echo `date` Change from $OIP to $CIP >> ip_change_log
       echo $CIP > old_ip
fi

もってっけー。気づいた人は目がいいかも。シェルスクリプト
因みに作りかけなので、今も、完成してからも無保証。