]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/dhcp
unbound/dhcp: stop lease bridge if dhcp was needed to killed
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / dhcp
index 083a555a3a5c9c01147d21f09d307e39fd30294c..2ae86db314f44d17c28136a30aff376f29144507 100644 (file)
@@ -7,7 +7,9 @@
 
 . /etc/sysconfig/rc
 . $rc_functions
+
 eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/dhcp/settings)
 
 function flush_chains() {
        iptables -F DHCPGREENINPUT
@@ -36,6 +38,12 @@ case "$1" in
                boot_mesg "Starting DHCP Server..."
                loadproc /usr/sbin/dhcpd -q ${devices}
 
+               # Start Unbound DHCP Lease Bridge unless RFC2136 is used
+               if [ "${DNS_UPDATE_ENABLED}" != on ]; then
+                       boot_mesg "Starting Unbound DHCP Leases Bridge..."
+                       loadproc /usr/sbin/unbound-dhcp-leases-bridge -d
+               fi
+
                (sleep 5 && chmod 644 /var/run/dhcpd.pid) & # Fix because silly dhcpd creates its pid with mode 640
                ;;
 
@@ -50,8 +58,10 @@ case "$1" in
                    killall -w -s KILL /usr/sbin/dhcpd > /dev/null 2>&1
                    rm -f /var/run/dhcpd.pid > /dev/null 2>&1
                    echo_ok;
-                   exit 0
                fi
+
+               boot_mesg "Stopping Unbound DHCP Leases Bridge..."
+               killproc /usr/sbin/unbound-dhcp-leases-bridge
                ;;
 
        reload)
@@ -67,6 +77,7 @@ case "$1" in
 
        status)
                statusproc /usr/sbin/dhcpd
+               statusproc /usr/sbin/unbound-dhcp-leases-bridge
                ;;
 
        *)