Skip to content

Instantly share code, notes, and snippets.

@jrh-spg
Created October 26, 2013 20:05
Show Gist options
  • Save jrh-spg/7173869 to your computer and use it in GitHub Desktop.
Save jrh-spg/7173869 to your computer and use it in GitHub Desktop.
Script to email you if your home IP changes.
#!/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