snippets/bash/dhclient-exit-hook-nsupdate.sh
Steffen Vogel 46313724b1 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
2013-10-18 15:03:46 +02:00

14 lines
363 B
Bash

#!/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