|
|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
|
|
|
local commit
|
|
|
+ local hostsfile
|
|
|
+
|
|
|
commit=0
|
|
|
|
|
|
if [ -z "$(uci -q get dhcp.odhcpd.piofolder)" ]; then
|
|
|
@@ -14,7 +16,23 @@ if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
|
|
|
commit=1
|
|
|
fi
|
|
|
|
|
|
+ hostsfile=$(uci -q get dhcp.odhcpd.hostsfile)
|
|
|
+ if [ -n "$hostsfile" ]; then
|
|
|
+ uci delete dhcp.odhcpd.hostsfile
|
|
|
+ uci set dhcp.odhcpd.hostsdir="$(dirname $hostsfile)"
|
|
|
+ commit=1
|
|
|
+ elif [ -z "$(uci -q get dhcp.odhcpd.hostsdir)" ]; then
|
|
|
+ uci set dhcp.odhcpd.hostsdir=/tmp/hosts
|
|
|
+ commit=1
|
|
|
+ fi
|
|
|
+
|
|
|
+ if [ "$(uci -q get dhcp.odhcpd.leasefile)" == "/tmp/hosts/odhcpd" ]; then
|
|
|
+ uci set dhcp.odhcpd.leasefile=/tmp/odhcpd.leases
|
|
|
+ commit=1
|
|
|
+ fi
|
|
|
+
|
|
|
[ "$commit" -eq 1 ] && uci commit dhcp
|
|
|
+
|
|
|
exit 0
|
|
|
fi
|
|
|
|
|
|
@@ -57,10 +75,11 @@ EOF
|
|
|
uci batch <<EOF
|
|
|
set dhcp.odhcpd=odhcpd
|
|
|
set dhcp.odhcpd.maindhcp=$ODHCPDONLY
|
|
|
-set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
|
|
|
+set dhcp.odhcpd.leasefile=/tmp/odhcpd.leases
|
|
|
set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
|
|
|
set dhcp.odhcpd.loglevel=4
|
|
|
set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder
|
|
|
+set dhcp.odhcpd.hostsdir=/tmp/hosts
|
|
|
set dhcp.lan.dhcpv4=$V4MODE
|
|
|
set dhcp.lan.dhcpv6=$V6MODE
|
|
|
set dhcp.lan.ra=$V6MODE
|