Created
          April 9, 2018 08:17 
        
      - 
      
 - 
        
Save Edison-Hsu/a5664fc5bf4e111db5c7c746e324f304 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
Edison-Hsu created this gist
Apr 9, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #! /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