blob: 94b4b4e87b4b00f2f1e2650fc0253d2194cfb58b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/bin/sh
#
# $FreeBSD$
# PROVIDE: htpdate
# REQUIRE: NETWORKING syslogd
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable htpdate:
#
# htpdate_enable="YES"
. /etc/rc.subr
name=htpdate
desc="HTTP Time Protocol daemon"
rcvar=htpdate_enable
load_rc_config htpdate
: ${htpdate_enable:="NO"}
: ${htpdate_servers:="www.example.com"}
: ${htpdate_flags:="-l -s -D"}
start_precmd=htpdate_prestart
command="%%PREFIX%%/bin/htpdate"
command_args="${htpdate_servers}"
htpdate_prestart()
{
local _pidfile="/var/run/htpdate.pid"
if [ -z "$(check_process "${command}")" ]; then
rm -f -- "${_pidfile}"
fi
}
run_rc_command "$1"
|