在ROS中使用花生壳的域名服务

ROS功能强大,也比较复杂,各个版本的脚本可能也大同小异,我现在使用的是6.37.3的版本。

添加Script

进入菜单System->Scripts。

System->Scripts

点击加号,像图中这样,添加代码,我给这段代码取的名字叫peanutddns,图中的域名用户名密码我做了遮挡,你需要改成你自己的域名、用户名和密码。

更新DNS的代码

local ipaddr
local server "http://ddns.oray.com"
local domain "你的域名.xicp.net"

local users "你的用户名"
local paswd "你的密码"
:set ipaddr [/ip address get [/ip address find interface=pppoe-out1] address]
:set ipaddr [:pick $ipaddr 0 ([len $ipaddr] -3)]
local par "/ph/update?hostname=$domain&myip=$ipaddr"

/tool fetch url=($server . $par) mode=http user=$users password=$paswd

增加Scheduler

增加Scheduler,这样就可以自动执行了。Scheduler菜单也System下, 就在Scripts的上面,第一幅截图里就有。
自动执行的Scheduler
我把Interval设成1天,也就是每天执行一次这段代码(执行时间是0点),下面的方框中填入刚刚的代码名字peanutddns就可以了

peanutddns


作者:xiao.chun(小春)
我的独立博客:http://1few.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.

原文地址:https://www.cnblogs.com/asis/p/6146527.html