This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

dyndns.org
#9
require('socket.http')

socket.http.timeout = 60

data = socket.http.request('http://checkip.dyndns.org/')


if not data then
log('No se puede comprobar la IP externa')
return
end

wan = "(%d+).(%d+).(%d+).(%d+)"
wan = string.sub(data, string.find(data, wan))
log(wan)

wanip = storage.get('wan_ip')


if wanip == nil then wanip = "0.0.0.0"
storage.set('wan_ip', wanip)
else

if wanip == wan then
--do nothing
else

subject = 'Nova IP: ' .. wan .. ''
message = 'La direcció IP ha canviat: http://' .. wan .. ':8080'
mail('mail@mail.com', subject, message)
--log("La nova IP publica externa es : " .. wan)
alert("La IP publica actual es: " .. wan) --ver registro alertas para cambios de IP
storage.set('wan_ip', wan)
log("S,envia mail. Nova IP: " .. wan)



require('ssl.https').request('https://user:password@members.dyndns.org/nic/update?hostname=name.dyndns.org&myip=' .. wan .. '&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG')


end
end

wan = storage.get('wan_ip')
log("La IP publica actual es: " .. wan)
Reply


Messages In This Thread
dyndns.org - by josep - 06.04.2016, 13:58
RE: dyndns.org - by zoltan - 06.04.2016, 14:39
RE: dyndns.org - by admin - 06.04.2016, 14:42
RE: dyndns.org - by josep - 06.04.2016, 15:25
RE: dyndns.org - by zoltan - 06.04.2016, 15:42
RE: dyndns.org - by admin - 07.04.2016, 08:31
RE: dyndns.org - by josep - 10.04.2016, 16:48
RE: dyndns.org - by zoltan - 10.04.2016, 16:58
RE: dyndns.org - by josep - 11.04.2016, 09:06
RE: dyndns.org - by buuuudzik - 09.08.2016, 08:37
RE: dyndns.org - by admin - 09.08.2016, 09:11
RE: dyndns.org - by buuuudzik - 09.08.2016, 09:16
RE: dyndns.org - by mooselight - 23.10.2018, 09:56
RE: dyndns.org - by admin - 09.08.2016, 10:31

Forum Jump: