From 46313724b11e98b9bcbfa85530f4d9ce1fe8ed2a Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 18 Oct 2013 15:03:46 +0200 Subject: [PATCH] added dhclient update hook Add this file to /etc/dhcp/dhclient-exit-hooks.d/nsupdate to update your dns autmatically when you get a new DHCP/IP lease from your ISP --- bash/dhclient-exit-hook-nsupdate.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bash/dhclient-exit-hook-nsupdate.sh diff --git a/bash/dhclient-exit-hook-nsupdate.sh b/bash/dhclient-exit-hook-nsupdate.sh new file mode 100644 index 0000000..838eb32 --- /dev/null +++ b/bash/dhclient-exit-hook-nsupdate.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +NS=/usr/local/bin/nsupdate.sh +key=/etc/bind/dhcp.key +zone=0l.de +host=wg.0l.de +server=127.0.0.1 + +case $reason in + BOUND|RENEW|REBIND|TIMEOUT) + $NS update -d $new_ip_address -k $key -z $zone -n $server -i $interface $host ;; + RELEASE) + $NS delete -d $old_ip_address -k $key -z $zone -n $server $host ;; +esac