mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-20 08:27:15 +00:00
b62a9b419b
Noticed by: sat Approved by: maintainer via mail
45 lines
703 B
Bash
45 lines
703 B
Bash
#!/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"
|