-
-
Save dash17291/5117429 to your computer and use it in GitHub Desktop.
This file contains 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
KEY=/etc/bind/Kize.domain.hu.+111+11111 | |
SERVER=1.2.3.4 | |
ZONE=domain.hu | |
HOSTNAME=ize | |
ddns_setup_set() { | |
if [ "$interface" != "eth0" ] && [ "$new_ip_address" = "$old_ip_address" ]; then | |
return | |
fi | |
( | |
sleep 5 | |
cat <<EOF | nsupdate -d -k "$KEY" 2>/dev/null | |
server $SERVER | |
zone $ZONE | |
update delete $HOSTNAME.$ZONE | |
update add $HOSTNAME.$ZONE 60 A $new_ip_address | |
send | |
EOF | |
) & | |
} | |
ddns_setup() { | |
case $reason in | |
BOUND|RENEW|REBIND|REBOOT) | |
ddns_setup_set | |
;; | |
*) | |
;; | |
esac | |
} | |
ddns_setup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment