IP-logger: shell script to check for changed ext IP and inform per pushmessage

For a Raspberry Pi which is placed at my mothers house (about 300 meters from my home) I wanted to know to which external IP-address it changes when this happens. Eventually I want it to automatically update the DNS-records for my .nl domainname which is linked to that Raspberry Pi. My internetprovider has an API to change the DNS-records.

While succesfully testing I was wondering whether this would work on OpenWRT, specifically on the GL-AR150. It came with some struggles and it needed some little modifications but I managed it to get it working. :slight_smile:

What it does:

  • With some assistance of crontab it checks the external IP-address every 30 minutes (on the whole hours and on the half hours).
  • When the IP-address fetched from ipecho.net differs from the one records with the previous run and informs you of the change of the IP-address by sending a pushmessage to your Pushbullet account (free to download).
 

Because of a lot documentation and maybe misinterpretting of the source by this forumsoftware I placed the documentation of the script and the script it self on my snippets and code website: Joen's code snippets pages - IP-logger

I assume you have the knowledge how to connect and operate a SSH session. Any further steps are explained at the documention on my website.

Feel free to react at this forumtopic, mail or my website. Also feel free to edit the script to your whiches and needs. I would be happy when you inform me about any changes you made!

 

1 Like

Hmmm… I did use a bullet-list, but the forumsoftware made a numbered list of it…

Very nice.

This is similar as our default ddns.