Created
January 30, 2013 14:33
-
-
Save mklooss/4673654 to your computer and use it in GitHub Desktop.
ez-ipupdate DynDNS Updater, without Spamming DynDNS
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
| */5 * * * * root /usr/local/bin/dyndns.sh > /dev/null |
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 | |
| IPTMP_FILE="/tmp/ipaddr.txt" | |
| touch $IPTMP_FILE | |
| CURRENT_IP="" | |
| CURRENT_IP=`/usr/bin/curl -s 1 -q http://www.gunah.eu/ip.php | xargs` | |
| OLD_IP="" | |
| OLD_IP=`/bin/cat /tmp/ipaddr.txt | xargs` | |
| source /etc/ez-ipupdate/GENERAL | |
| if [ ${#CURRENT_IP} != "0" ]; then | |
| if [ "$CURRENT_IP" != "$OLD_IP" ]; then | |
| for conf in /etc/ez-ipupdate/*.conf; do | |
| echo "set new ip `basename $CURRENT_IP`" | |
| /usr/sbin/ez-ipupdate -S $DYNTYPE --user $DYNUSER -c $conf -a $CURRENT_IP | |
| done | |
| echo $CURRENT_IP > $IPTMP_FILE | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment