DDNS script for Ros

Source: Internet
Author: User

Ros use ADSL, each dial-up IP will change, resulting in external network access to the ROS server failure, the most common solution is to use DDNS Dynamic Domain tool, after dialing (IP changes) notify the DDNS server update IP, This server can be permanently accessed using the static domain name provided by the DDNS service provider. ROS officials only support CHANGEIP, but other methods can also be implemented to support the peanut shell, the test passed the following script:

First, foreign Changeip script, modified from the CHANGEIP official website:

1 # Define User Variables2: Global Ddnsuser"User"3: Global Ddnspass"Password"4: Global Ddnshost"xxxx.onmypc.org"5: Global Ddnsinterface"Changkuan"6 7 # Define Global Variables8 : Global Ddnsip9 : Global DdnslastipTen  One:if([: typeof $ddnslastip] = Nothing) Do={: Global Ddnslastip"0" } A  - # Grab The current IP address in that interface. -: Global ddnsip [/IP address get [/IP AddressFindInterface=$ddnsinterface] Address the: LogInfo$ddnsip -# did we get a IP address to compare? -:if([: typeof $ddnsip] = nil) Do={ -: LogInfo("ddns:no IP Address present on". $ddnsinterface.", please check.") +}Else={ -  +:if($ddnsip! = $ddnslastip) Do={ A  at: LogInfo "ddns:sending update!" -: LogInfo[:p ut [/tool dns-update name= $ddnshost address=[:p ick $ddnsip0[:Find$ddnsip"/"]] Key-name= $ddnsuser key=$ddnspass]] - : Global Ddnslastip $ddnsip -  -}Else={  -: LogInfo "ddns:no update required." in   } -  to } +  -# End of script

Second, the domestic peanut shell script, the official script will be updated each time, according to the above-mentioned CHANGIP script modification, the implementation of IP changes before updating:

1Local server"http://ddns.oray.com"2Local domain"xxxx.oicp.net"3Local Users"User"4Local PASWD"Password"5Local Adslinterface"Changkuan"6 Local ipaddr7 : Global lastipaddr8 9set ipaddr [/IP address get [/IP AddressFindInterface=$adslinterface] AddressTen:if([: typeof $ipaddr] = nil) Do={ One: LogInfo("oray:no IP Address present on". $adslinterface.", please check.") A}Else={ -Set ipaddr [:p ick $ipaddr0([Len $ipaddr]-3)]    -: LogInfo$ipaddr the:if($ipaddr! = $lastipaddr) Do={ -Local Par"/ph/update?&hostname= $domain &myip= $ipaddr" -: LogInfo "oray:sending update!" -: LogInfo[:p ut [/tool fetch url= ($server. $par) mode=http user= $users password=$PASWD]] + : Global lastipaddr $ipaddr -  +}Else={  A: LogInfo "oray:no update required." at   } -}

DDNS script for Ros

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.