Last active
December 17, 2015 13:49
-
-
Save jalexandre0/5620360 to your computer and use it in GitHub Desktop.
Ip tracker when you can't use dyndns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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