找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4232|回复: 1

关于ipupdate

[复制链接]
发表于 2007-5-21 14:13:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
我下载了本站老大开发的ipupdate插件,在BFW启动后能更新IP地址(3322的),但在BFW连续运行2天左右,就不能自动更新了,而且用手动更新也不行,提示:
Checking need for update...
Current IP...: 222.213.**.**
Old IP.......: 222.213.**.**
Updating DynDNS -**.8866.org
nc: members.3322.org: Unknown host Response from www.3322.org

如果此时重新启动一下BFW,就可以更新了,这是什么原因呢?
routeros
发表于 2007-5-21 14:38:21 | 显示全部楼层
我已经在精华区回帖了~~
具体原因我也不清楚,没法实验,在我以前的测试、使用过程中,更新是自动的,没有问题。现在的情况不知道是希网修改了什么还是其他什么原因。
下面是具体的代码。你先看看。


  1. #!/bin/sh
  2. #
  3. # DDNS client for [url=http://www.3322.org/]www.3322.org[/url]
  4. # Code by DreamCat
  5. #       modify form dyndns
  6. #       thanks Claudio Roberto Cussuol
  7. #       23/01/2005
  8. #
  9. . /etc/coyote/coyote.conf
  10. [ "$N3322_UPDATE" != "YES" ] && exit
  11. if [ "$INETTYPE" = "PPPOE" -o "$INETTYPE" = "PPP" ]; then
  12.   IF_INET=ppp0
  13. elif [ -z "$IF_INET" ] ; then
  14.   IF_INET=eth1
  15. fi
  16. [ "$1" != "log" ] && echo Checking need for update...
  17. [ "$1" != "log" ] && logger [url=http://www.3322.org/]www.3322.org[/url] : Checking need for update...
  18. CURRENT=`getifaddr $IF_INET`
  19. if [ $? != 0 ]  ; then
  20.   echo Unable to get current IP
  21.   logger Unable to get current IP
  22.   exit 1
  23. fi
  24. [ "$1" != "log" ] && echo Current IP...: $CURRENT
  25. [ "$1" != "log" ] && logger [url=http://www.3322.org/]www.3322.org[/url] : Current IP...: $CURRENT
  26. if [ -e /var/log/www.3322.org.ip ] ; then
  27.   OLD=`cat /var/log/www.3322.org.ip`
  28. else
  29.   OLD=`nslookup $N3322_DOMAIN | tail -n 1 | sed s/Address:\ \ \ \ //`
  30. fi
  31. [ "$1" != "log" ] && echo Old IP.......: $OLD
  32. [ "$1" != "log" ] && logger [url=http://www.3322.org/]www.3322.org[/url] : Old IP.......: $OLD
  33. if [ "$1" = "force" ] ; then
  34.   echo Forcing update
  35.   logger [url=http://www.3322.org/]www.3322.org[/url] : Forcing update
  36.   OLD=""
  37. fi
  38. if [ "$CURRENT" != "$OLD" ] ; then
  39.   USUARIO=`echo -n "$N3322_USERNAME:$N3322_PASSWORD" | /ipupdate/b64 -e`
  40.   [ "$1" != "log" ] && echo Updating DynDNS - $N3322_DOMAIN
  41.   echo -e "GET /dyndns/update?system=$N3322_SYSTEM&hostname=$N3322_DOMAIN&offline=$N3322_BREAK HTTP/1.1\r\nUser-Agent: Mozilla/4.0\r\nHost: members.3322.org\r\nAuthorization: Basic $USUARIO\r\n\r\n" | nc  members.3322.org 80 > /var/log/N3322.txt
  42.   RESPONSE=`tail -n 1 /var/log/N3322.txt | head -n 1`
  43.   RESPCODE=`echo "$RESPONSE" | cut -f 1 -d " "`
  44.   if [ "$RESPCODE" = "good" -o "$RESPCODE" = "nochg" ] ; then
  45.     echo $CURRENT > /var/log/www.3322.org.ip
  46.   fi
  47.   [ "$1" != "log" ] && echo Response from [url=http://www.3322.org/]www.3322.org[/url]
  48.   [ "$1" != "log" ] && echo ========================
  49.   [ "$1" != "log" ] && echo $RESPONSE
  50.   [ "$1" != "log" ] && echo ========================
  51.   [ "$1" != "log" ] && echo
  52.   echo "======================================" >> /var/log/ipupdate.log
  53.   date >> /var/log/ipupdate.log
  54.   echo $CURRENT >> /var/log/ipupdate.log
  55.   echo Updating DynDNS - $N3322_DOMAIN >> /var/log/ipupdate.log
  56.   echo $RESPONSE >> /var/log/ipupdate.log
  57.   logger DYNDNS:Updating DynDNS - $N3322_DOMAIN - $CURRENT
  58.   logger DYNDNS:$RESPONSE
  59. else
  60.   [ "$1" != "log" ] && echo The update of $N3322_DOMAIN is not needed
  61.   [ "$1" != "log" ] && logger DYNDNS:The update of $N3322_DOMAIN is not needed
  62.   echo $CURRENT > /var/log/www.3322.org.ip
  63. fi
复制代码
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-24 03:51 , Processed in 0.040499 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表