-
-
Save Avasz/8084916 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| x=192.168.1.1 | |
| while : | |
| do | |
| y=$(curl icanhazip.com) | |
| if [ $x != $y ] | |
| then | |
| rm -rf /tmp/ipaddr | |
| touch /tmp/ipaddr | |
| echo "Current IP: $y" > /tmp/ipaddr | |
| mailx -s "IPADDRESS" [email protected] < /tmp/ipaddr | |
| x=$y | |
| fi | |
| sleep 1800 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment