Friday 22 January 2016

Send your public IP Address via mail.

I have a setup that i like to monitor/access remotely but the IP address assigned to me by my ISP is DHCP assigned and changes all the time and paying for a static address is expensive.
I have a raspberry pi that i use for automating processes and this hosts the script I wrote a python script that gets my public IP every 5 mins and sends it to me via mail.

If the IP is the same, i only get it once but once it changes, i get a mail with the updated IP.

Download the script from here, it sends a mail with only the IP address.
You have the option to log the IP address it retrieves. you will however need to modify the script by entering an email credential(i.e. the email account to use to send the mail) and the destination address, this script was written with Gmail in mind.
I have another script that fancies up the email format.......will upload that soon.

If using a pi, the below ensures the script starts up at boot,



At the bottom of the file before "exit 0", enter



where "/home/pi/Desktop/ip_smtp_send.py" is the location of the file.

If you have any issue, you can holla!!!


No comments:

Post a Comment