xref: /freebsd/contrib/ntp/scripts/rc/rc.d/ntpwait (revision 416ba5c74546f32a993436a99516d35008e9f384)
1*2b15cb3dSCy Schubert#!/bin/sh
2*2b15cb3dSCy Schubert# This script, when run, runs ntp-wait if ntpd is enabled.
3*2b15cb3dSCy Schubert
4*2b15cb3dSCy Schubert# PROVIDE: ntpwait
5*2b15cb3dSCy Schubert
6*2b15cb3dSCy Schubert. /etc/rc.subr
7*2b15cb3dSCy Schubert
8*2b15cb3dSCy Schubertname="ntpwait"
9*2b15cb3dSCy Schubertrcvar="ntpwait_enable"
10*2b15cb3dSCy Schubertstart_cmd="ntpwait_start"
11*2b15cb3dSCy Schubertntp_wait="/usr/sbin/ntp-wait"
12*2b15cb3dSCy Schubert
13*2b15cb3dSCy Schubertload_rc_config "$name"
14*2b15cb3dSCy Schubert
15*2b15cb3dSCy Schubertntpwait_start() {
16*2b15cb3dSCy Schubert        if checkyesno ntpd_enable; then
17*2b15cb3dSCy Schubert                $ntp_wait -v
18*2b15cb3dSCy Schubert        fi
19*2b15cb3dSCy Schubert}
20*2b15cb3dSCy Schubert
21*2b15cb3dSCy Schubertrun_rc_command "$1"
22