We have moved at community.getvera.com

Author Topic: Code to check WAN IP and execute code  (Read 69 times)

Offline imr

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Code to check WAN IP and execute code
« on: March 14, 2019, 05:29:41 pm »
Noob here, and looking for the easy way out :)

I need to create a scene than runs at certain intervals which can poll my WAN IP, check it against a string, and then execute an http command if true (or false).

Conceptually:

Find "WAN_IP" via external service (ie "https://ipcim.com/en/")

If "WAN_IP" contains "*.bidoof.com" then "http://x.x.x.x/command.cgi?user=admin&passwd=1234&device=0&command=1"

Can someone help me out with the lua code?

Thanks in advance.

Edited to add: more precisely, I want to compare against my WAN hostname.
« Last Edit: March 14, 2019, 05:37:24 pm by imr »