echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE_TMP
echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE
+ local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf"
+ if [ ! -r "$dnsmasqconffile" ]; then
+ dnsmasqconffile=/etc/dnsmasq.conf
+ fi
+
# if we did this last, we could override auto-generated config
- [ -f /etc/dnsmasq.conf ] && {
- xappend "--conf-file=/etc/dnsmasq.conf"
+ [ -f "${dnsmasqconffile}" ] && {
+ xappend "--conf-file=${dnsmasqconffile}"
}
$PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0
[ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript"
procd_set_param respawn
- local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf"
- if [ ! -r "$dnsmasqconffile" ]; then
- dnsmasqconffile=/etc/dnsmasq.conf
- fi
-
procd_add_jail dnsmasq ubus log
procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT
procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile