常用脚本-DDNS脚本
[
|
2007/05/14 20:16]
|
2007/05/14 20:16]
#2005/07/08 liujia 0.1 First time release
#######################################################
#
#
basedir="/opt/DDNS/"
keyfile="$basedir"/"Kks.+157+53638.key"
ttl=600
subip="eth0"
#outif="ppp0"
hostname="ks.thiz.com.cn"
servername="sh.thiz.com.cn"
#Get you new IP
newip=`/sbin/ifconfig "$subip" | grep 'inet addr' | cut -d: -f2 | cut -d' ' -f1`
#newip=`/sbin/ifconfig "$subip" | grep 'inet addr' | awk -F: '{print $2}' | awk '{print $1}'
#newip=`/sbin/ifconfig "$subip" |grep 'inet addr' | awk '{print $2}' | sed-e "s/addr\://"`
#checkip=`echo $newip | grep "^[0-9]"`
#if["$checkip"==""];then
# echo "$0: The interface isn't connect internet..."
# exit 1
#fi
# create the temp file
tmpfile=$basedir/tmp.txt
cd $basedir
echo "server $servername" > $tmpfile
echo "update delete $hostname A" >> $tmpfile
echo "update add $hostname $ttl A $newip" >> $tmpfile
echo "send" >> $tmpfile
# send you IP to server
nsupdate -k $keyfile -v $tmpfile
本文链接:http://www.52zhe.cn/read.php/6.htm
本文作者:kook(若就博客内所涉及的技术问题交流,请用下面的MSN或Gmail联系我)
联系方式:(MSN:kook#live.com) (Google talk:kookliu)
没有版权:GNU,转载时请注明“转载人”欠本人一顿饭,来日见面之时兑现!谢谢合作!
常用脚本-NAT脚本
常用脚本-Mysql数据库备份脚本



