udhcpc -n -q -s /bin/true -t 1 -i "$ifname" >&- && rv=1 || rv=0
- [ $rv -eq 1 ] && \
- logger -t dnsmasq \
- "found already running DHCP-server on interface '$ifname'" \
- "refusing to start, use 'option force 1' to override"
-
echo $rv > "$stamp"
return $rv
}
#check for an already active dhcp server on the interface, unless 'force' is set
config_get_bool force "$cfg" force 0
- [ $force -gt 0 ] || dhcp_check "$ifname" || return 0
+ [ $force -gt 0 ] || dhcp_check "$ifname" || {
+ logger -t dnsmasq \
+ "found already running DHCP-server on interface '$ifname'" \
+ "refusing to start, use 'option force 1' to override"
+ return 0
+ }
config_get start "$cfg" start 100
config_get limit "$cfg" limit 150
xappend "--conf-file=$TRUSTANCHORSFILE"
xappend "--dnssec"
[ -x /etc/init.d/sysntpd ] && {
- /etc/init.d/sysntpd enabled
- [ "$?" -ne 0 -o "$(uci_get system.ntp.enabled)" = "1" ] && {
+ if /etc/init.d/sysntpd enabled || [ "$(uci_get system.ntp.enabled)" = "1" ] ; then
[ -f "$TIMEVALIDFILE" ] || xappend "--dnssec-no-timecheck"
- }
+ fi
}
config_get_bool dnsseccheckunsigned "$cfg" dnsseccheckunsigned 1
[ "$dnsseccheckunsigned" -eq 0 ] && xappend "--dnssec-check-unsigned=no"