Skip to content
/ wnddns Public

Use Gmail API to send email when public IP changes

Notifications You must be signed in to change notification settings

WJDigby/wnddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

wnddns.py

The intent of this script is to send an email to the user's gmail account when their public IP changes. The script would run on a home server, so when remote the user would know if their home IP has changed. Running the script should be automated through cron or a task scheduler.

The script makes use of the ipify API: https://www.ipify.org/

Code for initializing the Gmail API and sending email are taken from Gmail's API guide:

Workflow is as follows:

  1. Cron job executes the script (set up outside this script)
  2. Script initializes the Gmail API object
  3. Script checks the current public IP using https://www.ipify.org
  4. Script compares current public IP with the stored (previous) public IP
  5. If IP has changed, script generates and sends an email with the updated IP.

About

Use Gmail API to send email when public IP changes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages