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