Created
April 9, 2018 08:17
-
-
Save Edison-Hsu/a5664fc5bf4e111db5c7c746e324f304 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/sh | |
| DOMAIN="us0.0bad.com" | |
| IP=`dig +short $DOMAIN` | |
| OLD_IP=`cat ip.txt` | |
| if [ "$OLD_IP" = "$IP" ]; then | |
| echo "query $DOMAIN address: $IP" >> query_ip.log | |
| else | |
| echo "query $DOMAIN address changed, old: $OLD_IP, new: $IP" >> query_ip.log | |
| echo $IP > ip.txt | |
| sh ip_forward.sh $IP | |
| fi; | |
| echo "$(tail -10 query_ip.log)" > query_ip.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment