\\ Home Page : Articolo : Stampa
Script per aggiornamento Dynamic DNS
Di Admin (del 03/09/2007 @ 14:27:48, in Internet, linkato 1706 volte)
Con questo script e' possibile tenere sincronizzato il servizio di IP dinamico fornito da Nettica.com (o, adattando la richiesta HTTP, un altro servizio equivalente) da un qualsiasi pc con Windows.

Lo script ha bisogno dell'applicazione wget.exe memorizzata nella cartella /utils.

-----------------------------------

@echo off

set USERNAME=foo
set PASSWORD=fooPassword
set FQDN=mysite.domain.com
set UPDATE_INTERVAL=60000

if NOT EXIST SPOOL goto MakeSpool
:doneSpool
if NOT EXIST utils\wget.exe goto noWget

:loop
move spool\current_ip spool\old_ip
REM Let's read current IP

.\Utils\wget.exe http://ip.nettica.com:8245/ -O spool\current_ip

REM Setting environment variables to old and current IPs
set /P CURR_IP=IPset /P OLD_IP=IPif "%CURR_IP%"=="%OLD_IP%" goto end

echo Updating IP!
.\Utils\wget.exe -S --no-check-certificate -O NUL "https://www.nettica.com/Domain/Update.aspx?U=%USERNAME%&PC=%PASSWORD%&FQDN=%FQDN%&N=%CURR_IP%"

:end

rem Wait
PING 1.1.1.1 -n 1 -w %UPDATE_INTERVAL% >NUL
goto loop

:makeSpool
md spool
goto doneSpool

:noWget
echo Please, download wget.exe and put it into utils sub-directory
pause