# Assemble resolv.conf using our head and tail files
[ -f "$cf" ] && rm -f "$cf"
+ [ -d "$resolv_conf_dir" ] || mkdir -p "$resolv_conf_dir"
echo "$header" > "$cf"
if [ -f /etc/resolv.conf.head ]; then
cat /etc/resolv.conf.head >> "$cf"
if [ -e "$resolv_conf_dir/$interface" ]; then
rm -f "$resolv_conf_dir/$interface"
fi
- if [ ! -d "$resolv_conf_dir" ]; then
- mkdir -p "$resolv_conf_dir"
- fi
+ [ -d "$resolv_conf_dir" ] || mkdir -p "$resolv_conf_dir"
printf "$conf" > "$resolv_conf_dir/$interface"
build_resolv_conf
}
# Detect OpenRC or BSD rc
# Distributions may want to just have their command here instead of this
if type rc-service >/dev/null 2>&1 && rc-service --exists ntpd; then
- ntpd_restart_cmd="rc-service ntpd -- --ifstarted --quiet restart"
+ ntpd_restart_cmd="rc-service ntpd -- -Ds restart"
elif [ -x /etc/rc.d/ntpd ]; then
- ntpd_restart_cmd="/etc/rc.d/ntpd status && /etc/rc.d/ntpd restart"
+ ntpd_restart_cmd="/etc/rc.d/ntpd status >/dev/null 2>&1 && /etc/rc.d/ntpd restart"
elif [ -x /usr/local/etc/rc.d/ntpd ]; then
- ntpd_restart_cmd="/usr/local/etc/rc.d/ntpd status && /usr/local/etc/rc.d/ntpd restart"
+ ntpd_restart_cmd="/usr/local/etc/rc.d/ntpd status >/dev/null 2>&1 && /usr/local/etc/rc.d/ntpd restart"
fi
ntp_conf_dir="$state_dir/ntp.conf"
# Merge our config into ntp.conf
[ -e "$cf" ] && rm -f "$cf"
+ [ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
remove_markers "$signature_base" "$signature_base_end" \
"$ntp_conf" > "$cf"
if [ -n "$servers" ]; then