added 'DHCP_HOSTS=foo bar' to add dhcp-host entries to dnsmasq.conf

This commit is contained in:
David Rose 2024-06-13 00:18:12 +00:00
parent 8ac2bb1a3e
commit bfe7ca6f4b
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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=