summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-03-29 20:00:54 +0000
committerdes <des@FreeBSD.org>2004-03-29 20:00:54 +0000
commit3f9f949de684edadf0e8a4996512188b7eecf6cf (patch)
tree19463573e25bca8a69538f01fcb758893516545e /etc
parent21981a0b0ef6210bce20420b7c516714f6cbb10c (diff)
downloadFreeBSD-src-3f9f949de684edadf0e8a4996512188b7eecf6cf.zip
FreeBSD-src-3f9f949de684edadf0e8a4996512188b7eecf6cf.tar.gz
Fix the case where $ntpdate_hosts was not specified and /etc/ntp.conf
does not exist. Submitted by: ru
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.d/ntpdate4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/rc.d/ntpdate b/etc/rc.d/ntpdate
index b2f4055..1ef9b61 100755
--- a/etc/rc.d/ntpdate
+++ b/etc/rc.d/ntpdate
@@ -17,13 +17,13 @@ start_cmd="ntpdate_start"
ntpdate_start()
{
- if [ -z "$ntpdate_hosts" ]; then
+ if [ -z "$ntpdate_hosts" -a -f /etc/ntp.conf ]; then
ntpdate_hosts=`awk '
/^server[ \t]*127.127/ {next}
/^(server|peer)/ {print $2}
' </etc/ntp.conf`
fi
- if [ -n "$ntpdate_hosts" ]; then
+ if [ -n "$ntpdate_hosts" -o -n "$rc_flags" ]; then
echo "Setting date via ntp."
${ntpdate_command:-ntpdate} $rc_flags $ntpdate_hosts
fi
OpenPOWER on IntegriCloud