summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorflz <flz@FreeBSD.org>2006-07-20 10:07:34 +0000
committerflz <flz@FreeBSD.org>2006-07-20 10:07:34 +0000
commit146016a7bbcca247253eb45157e1454f61dd304a (patch)
tree1446f4b272688a1375b6b5b4c5f6b25a685f6289 /etc
parent7d273f184492bc4d089b169be21e8e9e38ae77f4 (diff)
downloadFreeBSD-src-146016a7bbcca247253eb45157e1454f61dd304a.zip
FreeBSD-src-146016a7bbcca247253eb45157e1454f61dd304a.tar.gz
- Remove hardcoded /etc/ntp.conf configuration file from ntpdate rc.d script
and replace it with a new ntpdate_config variable. - Document it in defaults/rc.conf and rc.conf.5. - Document ntpdate_hosts in defaults/rc.conf. Requested by: Chris Timmons <cwt@networks.cwu.edu> Approved by: cperciva (mentor, implicit) MFC after: 1 week
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/rc.conf2
-rwxr-xr-xetc/rc.d/ntpdate4
2 files changed, 4 insertions, 2 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 02526b3..1bd2af7 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -261,6 +261,8 @@ timed_flags="" # Flags to timed (if enabled).
ntpdate_enable="NO" # Run ntpdate to sync time on boot (or NO).
ntpdate_program="/usr/sbin/ntpdate" # path to ntpdate, if you want a different one.
ntpdate_flags="-b" # Flags to ntpdate (if enabled).
+ntpdate_config="/etc/ntp.conf" # ntpdate(8) configuration file
+ntpdate_hosts="" # Whitespace-separated list of ntpdate(8) servers.
ntpd_enable="NO" # Run ntpd Network Time Protocol (or NO).
ntpd_program="/usr/sbin/ntpd" # path to ntpd, if you want a different one.
ntpd_config="/etc/ntp.conf" # ntpd(8) configuration file
diff --git a/etc/rc.d/ntpdate b/etc/rc.d/ntpdate
index 84c4734..c76f7a0 100755
--- a/etc/rc.d/ntpdate
+++ b/etc/rc.d/ntpdate
@@ -16,11 +16,11 @@ start_cmd="ntpdate_start"
ntpdate_start()
{
- if [ -z "$ntpdate_hosts" -a -f /etc/ntp.conf ]; then
+ if [ -z "$ntpdate_hosts" -a -f ${ntpdate_config} ]; then
ntpdate_hosts=`awk '
/^server[ \t]*127.127/ {next}
/^(server|peer)/ {print $2}
- ' </etc/ntp.conf`
+ ' < ${ntpdate_config}`
fi
if [ -n "$ntpdate_hosts" -o -n "$rc_flags" ]; then
echo "Setting date via ntp."
OpenPOWER on IntegriCloud