2021-03-23 01:47:23 +00:00
|
|
|
#!/bin/sh
|
2021-04-06 14:21:47 +00:00
|
|
|
|
2021-03-23 01:47:23 +00:00
|
|
|
# PROVIDE: jamulus-server
|
|
|
|
# REQUIRE: DAEMON NETWORKING
|
|
|
|
# KEYWORD: shutdown
|
|
|
|
|
|
|
|
# Add the following lines to /etc/rc.conf to enable jamulus_server:
|
2022-01-03 07:05:56 +00:00
|
|
|
# jamulus_server_enable : set to "YES" to enable the daemon, default is "NO"
|
|
|
|
# jamulus_server_uname : user to run jamulus-server as, default is "%%USER%%"
|
|
|
|
# jamulus_server_flags : extra flags to pass to daemon(8), default is ""
|
|
|
|
# jamulus_server_args : any arguments to pass to jamulus-server, default is ""
|
|
|
|
# - list of all possible arguments: https://jamulus.io/wiki/Command-Line-Options
|
2021-03-23 01:47:23 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name=jamulus_server
|
|
|
|
rcvar=jamulus_server_enable
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
|
|
|
|
jamulus_server_enable=${jamulus_server_enable:-"NO"}
|
2022-01-03 07:05:56 +00:00
|
|
|
jamulus_server_uname=${jamulus_server_uname:-"%%USER%%"}
|
2021-03-23 01:47:23 +00:00
|
|
|
jamulus_server_flags=${jamulus_server_flags:-""}
|
2022-01-03 07:05:56 +00:00
|
|
|
jamulus_server_args=${jamulus_server_args:-""}
|
2021-03-23 01:47:23 +00:00
|
|
|
|
|
|
|
logfile="/var/log/${name}.log"
|
|
|
|
|
|
|
|
procname=%%PREFIX%%/bin/jamulus-server
|
|
|
|
command="/usr/sbin/daemon"
|
2022-01-03 07:05:56 +00:00
|
|
|
command_args="-u ${jamulus_server_uname} -o ${logfile} -t ${name} %%PREFIX%%/bin/jamulus-server -s ${jamulus_server_args}"
|
2021-03-23 01:47:23 +00:00
|
|
|
|
|
|
|
run_rc_command "$1"
|