Skip to content

Instantly share code, notes, and snippets.

@jalexandre0
Last active December 17, 2015 13:49
Show Gist options
  • Save jalexandre0/5620360 to your computer and use it in GitHub Desktop.
Save jalexandre0/5620360 to your computer and use it in GitHub Desktop.
Ip tracker when you can't use dyndns
#!/bin/bash
IP=$(curl -s ifconfig.me)
LAST_IP=$(cat /tmp/myip )
if [ "$IP" = "$LAST_IP" ]
then exit 0
else echo $IP > /tmp/myip ; echo $IP | mail -s "Valid IP for host XPTO" notifications@company.com
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment