diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile index c9eddf3a3e..86de3d67e2 100644 --- a/net/isc-dhcp/Makefile +++ b/net/isc-dhcp/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=isc-dhcp UPSTREAM_NAME:=dhcp PKG_REALVERSION:=4.4.3-P1 PKG_VERSION:=4.4.3_p1 -PKG_RELEASE:=13 +PKG_RELEASE:=14 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init index d7f24d9be0..6e1cb53f72 100755 --- a/net/isc-dhcp/files/dhcpd.init +++ b/net/isc-dhcp/files/dhcpd.init @@ -154,7 +154,7 @@ EOF } create_empty_zone() { - local zone error zpath + local zone error zpath command zone="$1" zpath="$dyndir/db.$zone" @@ -167,7 +167,15 @@ create_empty_zone() { chown bind:bind "$zpath" || return 1 chmod 0664 "$zpath" || return 1 - if ! error=$(rndc modzone $zone "{ + # if the zone doesn't exist, we need to add it, otherwise we need to + # create it. + if ! rndc zonestatus $zone >/dev/null 2>&1; then + command="addzone" + else + command="modzone" + fi + + if ! error=$(rndc $command $zone "{ type primary; file \"$zpath\"; update-policy {