summaryrefslogtreecommitdiff
path: root/net/htpdate/files/htpdate.in
blob: 0c0753ef2819c0b61f555db45aefba370529cbe5 (plain) (blame)
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
#!/bin/sh

# 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"