上等兵
- 注册时间
- 2008-9-3
- 金币
- 47 个
- 威望
- 0 个
- 荣誉
- 0 个
尚未签到
|
本帖最后由 tempvipuser 于 2015-10-21 22:00 编辑
DD默认DDNS列表里没有oray更新,可通过以下加入到cron中实现自动更新。
- */15 * * * * root sh /var/run/orayupdate.sh
复制代码
/var/run/orayupdte.sh
- #!/bin/bash
- orayuser=orayusername
- oraypasswd=oraypassword
- orayhost=yourdomain
- currentip=`nslookup $orayhost | tail -1 |cut -d ' ' -f 3 -s`
- realip=`curl http://1111.ip138.com/ic.asp |cut -d '[' -f 2 -s |cut -d ']' -f 1 -s`
- orayupdateurl="http://$orayuser:$oraypasswd@ddns.oray.com/ph/update?hostname=$orayhost&myip=$realip"
- if [ "$realip" = "$currentip" ]; then
- echo $(date) :no change >>oraylog.log
- else
- curl "$orayupdateurl"
- echo $(date) Update success: $currentip '-->' $realip >>oraylog.log
- fi
复制代码 |
|