Created
October 26, 2013 20:05
-
-
Save jrh-spg/7173869 to your computer and use it in GitHub Desktop.
Script to email you if your home IP changes.
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=`cat /tmp/ip` | |
PUBIP=`curl -s http://icanhazip.com` | |
EMAIL=youremail@domain.com | |
if [ "$IP" != "$PUBIP" ]; then | |
echo $PUBIP|mail -s "IP changed at home" $EMAIL | |
echo $PUBIP > /tmp/ip | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment