ADD_LOCAL_FQDN=""
BASECONFIGFILE="/var/etc/dnsmasq.conf"
+EXTRACONFFILE="extraconfig.conf"
BASEHOSTFILE="/tmp/hosts/dhcp"
TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf"
TIMEVALIDFILE="/var/state/dnsmasqsec"
xappend "--dhcp-broadcast=tag:needs-broadcast"
- config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq.d"
+ # Create a dnsmasq.d dir for each instance
+ config_get dnsmasqconfdir "$cfg" confdir "/tmp/dnsmasq${cfg:+.$cfg}.d"
xappend "--conf-dir=$dnsmasqconfdir"
dnsmasqconfdir="${dnsmasqconfdir%%,*}"
- [ ! -d "$dnsmasqconfdir" ] && mkdir -p $dnsmasqconfdir
+ [ ! -d "$dnsmasqconfdir" ] && mkdir -p "$dnsmasqconfdir"
xappend "--user=dnsmasq"
xappend "--group=dnsmasq"
echo >> $CONFIGFILE_TMP
+ # EXTRACONFFILE allows new dnsmasq parameters before they are natively handled in this init file
+ config_get extraconftext "$cfg" extraconftext
+ [ -n "$extraconftext" ] && echo -e "$extraconftext" > "$dnsmasqconfdir"/"$EXTRACONFFILE"
+
config_get_bool enable_tftp "$cfg" enable_tftp 0
[ "$enable_tftp" -gt 0 ] && {
config_get tftp_root "$cfg" tftp_root