#!/bin/sh
if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
+ local commit
+ commit=0
+
if [ -z "$(uci -q get dhcp.odhcpd.piofolder)" ]; then
uci set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder
- uci commit dhcp
+ commit=1
+ fi
+
+ if [ -n "$(uci -q get dhcp.odhcpd.legacy)" ]; then
+ uci delete dhcp.odhcpd.legacy
+ commit=1
fi
+ [ "$commit" -eq 1 ] && uci commit dhcp
exit 0
fi
;;
esac
-uci get dhcp.lan 1>/dev/null 2>/dev/null || {
+uci -q get dhcp.lan || {
uci batch <<EOF
set dhcp.lan=dhcp
set dhcp.lan.interface='lan'