Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6971
  • 博文数量: 4
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 35
  • 用 户 组: 普通用户
  • 注册时间: 2015-06-10 17:37
文章分类
文章存档

2015年(4)

我的朋友

分类: 其他UNIX

2015-06-24 17:02:22


点击(此处)折叠或打开

  1. :global ednsuser "ixxxxn"
  2. :global ednspass "yxxxx7"
  3. :global ednshost "ixxxxn.3322.org"
  4. :global ednsinterface "pppoe-out1"
  5. :global members "\?system=dyndns"
  6. :global status
  7. :global status [/interface get [/interface find name=$ednsinterface] running]
  8. :if ($status!=false) do={
  9. :global ednslastip [:resolve $ednshost]
  10. :if ([ :typeof $ednslastip ] = nil ) do={ :global ednslastip "0" }
  11. :global ednsiph [ /ip address get [/ip address find interface=$ednsinterface ] address ]
  12. :global ednsip [:pick $ednsiph 0 [:find $ednsiph "/"]]
  13. :global ednsstr "&hostname=$ednshost&myip=$ednsip"
  14. :if ($ednslastip != $ednsip) do={
  15. /tool fetch url="$members$ednsstr" mode=http user=$ednsuser password=$ednspass dst-path=$ednshost
  16. :delay 4
  17. :global result [/file get $ednshost contents]
  18. :log info ($ednshost . " " .$result)
  19. /file remove $ednshost ;
  20. }
  21. }

点击(此处)折叠或打开

  1. 改变默认网关
  2. /ip route set [/ip route find dst-address=0.0.0.0/0] gateway=xxx.xxx.xxx.xxx
  3. 定时重起
  4. /system scheduler add name=reboot interval=24h start-time=11:59:00 on-event={/system reboot} disabled=no
  5. 定时执行
  6. system scheduler add name=DDNSs interval=00:05:00 start-time=00:00:00 on-event=":execute DDNS"
收集的代码,将来也许会用到
阅读(2123) | 评论(0) | 转发(0) |
0

上一篇:linux ssh登录慢解决方法

下一篇:没有了

给主人留下些什么吧!~~