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.

ip public router
#1
Hi:

We have a router with dinamic ip and I wanted to know how to send a message when this changes.


Is this possible?

Thanks
Reply
#2
Add a scheduled script which runs once in an hour or more frequently, depending on your needs:

Code:
http = require('socket.http')
ip = http.request('http://openrb.com/ip')

if ip then
  ip_old = storage.get('lm_ip', '')
  
  if ip ~= ip_old then
     subject = 'LM IP changed'
     message = 'New IP: ' .. ip
     mail('user@example.com', subject, message)
     storage.set('lm_ip', ip)
  end
end
Reply


Forum Jump: