summaryrefslogtreecommitdiff
path: root/net/stund/files/stund.in
blob: c450386600ef610b8fa9e126a4a01c1962d669d9 (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
#!/bin/sh

# PROVIDE: stund
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

. /etc/rc.subr

: ${stund_enable:=NO}
: ${stund_pidfile:=/var/run/stund.pid}
: ${stund_flags="-h \"\$stund_ip1\" -a \"\$stund_ip2\" -b"}

name="stund"
command="%%PREFIX%%/sbin/stund"
rcvar=stund_enable
extra_commands="status"
pidfile="$stund_pidfile"

load_rc_config $name

start_precmd=stund_prestart
stund_prestart() {
	if [ -z "$stund_ip1" -o -z "$stund_ip2" ]; then
		echo stund: failed: you must set stund_ip1 and stund_ip2 1>&2
		return 1
	fi
	return 0
}

run_rc_command "$1"