From bfe7ca6f4bab6e20e1a94197714b1938e4ac3337 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 13 Jun 2024 00:18:12 +0000 Subject: [PATCH] added 'DHCP_HOSTS=foo bar' to add dhcp-host entries to dnsmasq.conf --- src/scripts/create_ap | 8 +++++++- src/scripts/create_ap.conf | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/scripts/create_ap b/src/scripts/create_ap index 3ee3440..ea93d1d 100755 --- a/src/scripts/create_ap +++ b/src/scripts/create_ap @@ -1802,7 +1802,13 @@ EOF [[ -n "$MTU" ]] && echo "dhcp-option-force=option:mtu,${MTU}" >> $CONFDIR/dnsmasq.conf [[ $ETC_HOSTS -eq 0 ]] && echo no-hosts >> $CONFDIR/dnsmasq.conf [[ -n "$ADDN_HOSTS" ]] && echo "addn-hosts=${ADDN_HOSTS}" >> $CONFDIR/dnsmasq.conf - [[ -n "$DHCP_HOSTS" ]] && echo $DHCP_HOSTS >> $CONFDIR/dnsmaq.conf + if [[ -n "$DHCP_HOSTS" ]]; then + for HOST in $DHCP_HOSTS; do + echo "dhcp-host=${HOST}" >> $CONFDIR/dnsmasq.conf + done + fi + + if [[ -n "$DNS_LOGFILE" ]]; then cat << EOF >> $CONFDIR/dnsmasq.conf log-queries diff --git a/src/scripts/create_ap.conf b/src/scripts/create_ap.conf index f57da55..3921382 100644 --- a/src/scripts/create_ap.conf +++ b/src/scripts/create_ap.conf @@ -27,5 +27,5 @@ INTERNET_IFACE=eth0 SSID=MyAccessPoint PASSPHRASE=12345678 USE_PSK=0 -DHCP_HOSTS="dhcp-host=foo,bar\ndhcp-host=bar,foo" +DHCP_HOSTS=