diff --git a/package/network/services/dnsmasq/files/dhcp-script.sh b/package/network/services/dnsmasq/files/dhcp-script.sh index 470097bf6bd..f0c8b509020 100755 --- a/package/network/services/dnsmasq/files/dhcp-script.sh +++ b/package/network/services/dnsmasq/files/dhcp-script.sh @@ -8,6 +8,15 @@ json_init json_add_array env hotplugobj="" +oldIFS=$IFS +IFS=$'\n' +for var in $(env); do + if [ "${var}" != "${var#DNSMASQ_}" ]; then + json_add_string "" "${var%%=*}=${var#*=}" + fi +done +IFS=$oldIFS + case "$1" in add | del | old | arp-add | arp-del) json_add_string "" "MACADDR=$2" diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index b864ea90699..2e07e13d367 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -20,7 +20,7 @@ BASEDHCPSTAMPFILE="/var/run/dnsmasq" DHCPBOGUSHOSTNAMEFILE="/usr/share/dnsmasq/dhcpbogushostname.conf" RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf" DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh" -DHCPSCRIPT_DEPENDS="/usr/share/libubox/jshn.sh /usr/bin/jshn /bin/ubus" +DHCPSCRIPT_DEPENDS="/usr/share/libubox/jshn.sh /usr/bin/jshn /bin/ubus /usr/bin/env" DNSMASQ_DHCP_VER=4