summaryrefslogtreecommitdiff
path: root/net/ris/files/binlsrv.sh.in
blob: bde2e0904856c53dd66598d4b98356ffbaa8f5b0 (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
40
41
42
43
44
#!/bin/sh

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

#
# Add the following lines to /etc/rc.conf to enable binlsrv:
#
# binlsrv_enable="YES"
# binlsrv_infdir="/path/to/inf/files"
#

. %%RC_SUBR%%

name="binlsrv"
rcvar=`set_rcvar`

load_rc_config "${name}"

# Set defaults
: ${binlsrv_enable:="NO"}
: ${binlsrv_infdir:="%%DATADIR%%/inf"}

pidfile="%%PID_FILE%%"
command="%%PYTHON_CMD%%"
command_args="%%DATADIR%%/${name}.py -d"
required_dirs="$binlsrv_infdir"

start_precmd="binlsrv_start_precmd"
stop_postcmd="binlsrv_stop_postcmd"

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

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

run_rc_command "$1"