aboutsummaryrefslogtreecommitdiff
path: root/net/ris/files/binlsrv.sh.in
blob: 1b3473df512aff63ee70ab23425ffb8ff0775cdf (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
38
39
40
41
#!/bin/sh

# PROVIDE: binlsrv
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

# Define these variables in one of these files:
#	/etc/rc.conf
#	/etc/rc.conf.local
#	/etc/rc.conf.d/binlsrv
#
# binlsrv_enable="YES"
# binlsrv_infdir="/path/to/dir_with_inf_files"

. /etc/rc.subr

name="binlsrv"
rcvar=`set_rcvar`
command="%%PYTHON_CMD%%"
command_args="%%PREFIX%%/sbin/${name}.py -d"
required_dirs="${binlsrv_infdir}"
pidfile="%%PID_FILE%%"
start_precmd="binlsrv_start_precmd"
stop_postcmd="binlsrv_stop_postcmd"

binlsrv_start_precmd()
{
	%%PREFIX%%/sbin/infparser.py ${binlsrv_infdir}
}

binlsrv_stop_postcmd()
{
	rm -f ${pidfile}
}

load_rc_config "$name"
: ${binlsrv_enable="NO"}
: ${binlsrv_infdir=""}

run_rc_command "$1"