local opt="${value%%=*}"
if ! dnsmasq_ignore_opt "$opt"; then
- echo "$value" >>$CONFIGFILE_TMP
+ echo "$value" >>"$CONFIGFILE_TMP"
fi
}
config_get_bool dns "$cfg" dns 0
[ "$dns" = "1" ] && [ -n "$ip" ] && [ -n "$name" ] && {
- echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE_TMP
+ echo "$ip $name${DOMAIN:+.$DOMAIN}" >> "$HOSTFILE_TMP"
}
config_get mac "$cfg" mac
record="${record:+$record }$name"
done
- echo "$ip $record" >> $HOSTFILE_TMP
+ echo "$ip $record" >> "$HOSTFILE_TMP"
}
dhcp_srv_add() {
# before we can call xappend
umask u=rwx,g=rx,o=rx
mkdir -p /var/run/dnsmasq/
- mkdir -p $(dirname $CONFIGFILE)
+ mkdir -p "$(dirname "$CONFIGFILE")"
mkdir -p "$HOSTFILE_DIR"
mkdir -p /var/lib/misc
chown dnsmasq:dnsmasq /var/run/dnsmasq
- echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE_TMP
- echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE_TMP
+ echo "# auto-generated config file from /etc/config/dhcp" > "$CONFIGFILE_TMP"
+ echo "# auto-generated config file from /etc/config/dhcp" > "$HOSTFILE_TMP"
local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf"
if [ ! -r "$dnsmasqconffile" ]; then
[ ! -d "$dnsmasqconfdir" ] && mkdir -p "$dnsmasqconfdir"
xappend "--user=dnsmasq"
xappend "--group=dnsmasq"
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
# EXTRACONFFILE allows new dnsmasq parameters before they are natively handled in this init file
config_get extraconftext "$cfg" extraconftext
}
config_foreach filter_dnsmasq host dhcp_host_add "$cfg"
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
config_get_bool dhcpbogushostname "$cfg" dhcpbogushostname 1
[ "$dhcpbogushostname" -gt 0 ] && {
config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg"
[ -n "$BOOT" ] || config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg"
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg"
config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg"
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
config_get_bool boguspriv "$cfg" boguspriv 1
[ "$boguspriv" -gt 0 ] && {
fi
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg"
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
config_foreach filter_dnsmasq ipset dnsmasq_ipset_add "$cfg"
- echo >> $CONFIGFILE_TMP
+ echo >> "$CONFIGFILE_TMP"
- mv -f $CONFIGFILE_TMP $CONFIGFILE
- mv -f $HOSTFILE_TMP $HOSTFILE
+ mv -f "$CONFIGFILE_TMP" "$CONFIGFILE"
+ mv -f "$HOSTFILE_TMP" "$HOSTFILE"
[ "$localuse" -gt 0 ] && {
rm -f /tmp/resolv.conf