Changeset View
Changeset View
Standalone View
Standalone View
multimedia/emby-server/files/emby-server.in
Show All 16 Lines | |||||
# Default: %%USER%% | # Default: %%USER%% | ||||
# %%RC_NAME%%_group: The group account used to run the %%PORTNAME%% daemon. | # %%RC_NAME%%_group: The group account used to run the %%PORTNAME%% daemon. | ||||
# This is optional, however do not specifically set this to an | # This is optional, however do not specifically set this to an | ||||
# empty string as this will cause the daemon to run with group wheel. | # empty string as this will cause the daemon to run with group wheel. | ||||
# Default: %%GROUP%% | # Default: %%GROUP%% | ||||
# %%RC_NAME%%_data_dir: Directory where %%PORTNAME%% configuration | # %%RC_NAME%%_data_dir: Directory where %%PORTNAME%% configuration | ||||
# data is stored. | # data is stored. | ||||
# Default: /var/db/%%PORTNAME%% | # Default: /var/db/%%PORTNAME%% | ||||
# %%RC_NAME%%_ffdetect: Path of the ffdetect binary. | |||||
# Default: %%PREFIX%%/lib/emby-server/bin/ffdetect | |||||
mat: `PREFIX` (Actually, you copied the typo.) | |||||
# %%RC_NAME%%_ffmpeg: Path of the ffmpeg binary. | # %%RC_NAME%%_ffmpeg: Path of the ffmpeg binary. | ||||
# Default: %%PEFIX%%/lib/emby-server/bin/ffmpeg | # Default: %%PREFIX%%/lib/emby-server/bin/ffmpeg | ||||
# %%RC_NAME%%_ffprobe: Path of the ffprobe binary. | # %%RC_NAME%%_ffprobe: Path of the ffprobe binary. | ||||
# Default: %%PEFIX%%/lib/emby-server/bin/ffprobe | # Default: %%PREFIX%%/lib/emby-server/bin/ffprobe | ||||
. /etc/rc.subr | . /etc/rc.subr | ||||
name=%%RC_NAME%% | name=%%RC_NAME%% | ||||
rcvar=${name}_enable | rcvar=${name}_enable | ||||
load_rc_config ${name} | load_rc_config ${name} | ||||
[ -z "${emby_server_user}" ] && %%RC_NAME%%_user=%%USER%% | |||||
[ -z "${emby_server_group}" ] && %%RC_NAME%%_group=%%GROUP%% | |||||
[ -z "${emby_server_data_dir}" ] && %%RC_NAME%%_data_dir=/var/db/%%PORTNAME%% | |||||
[ -z "${emby_server_ffmpeg}" ] && %%RC_NAME%%_ffmpeg=%%PREFIX%%/lib/emby-server/bin/ffmpeg | |||||
[ -z "${emby_server_ffprobe}" ] && %%RC_NAME%%_ffprobe=%%PREFIX%%/lib/emby-server/bin/ffprobe | |||||
: ${%%RC_NAME%%_enable:="no"} | : ${%%RC_NAME%%_enable:="no"} | ||||
: ${%%RC_NAME%%_user:="%%USER%%"} | : ${%%RC_NAME%%_user:="%%USER%%"} | ||||
: ${%%RC_NAME%%_group:="%%GROUP%%"} | : ${%%RC_NAME%%_group:="%%GROUP%%"} | ||||
: ${%%RC_NAME%%_data_dir:="/var/db/%%PORTNAME%%"} | : ${%%RC_NAME%%_data_dir:="/var/db/%%PORTNAME%%"} | ||||
: ${%%RC_NAME%%_ffdetect:="%%PREFIX%%/lib/emby-server/bin/ffdetect"} | |||||
: ${%%RC_NAME%%_ffmpeg:="%%PREFIX%%/lib/emby-server/bin/ffmpeg"} | : ${%%RC_NAME%%_ffmpeg:="%%PREFIX%%/lib/emby-server/bin/ffmpeg"} | ||||
: ${%%RC_NAME%%_ffprobe:="%%PREFIX%%/lib/emby-server/bin/ffprobe"} | : ${%%RC_NAME%%_ffprobe:="%%PREFIX%%/lib/emby-server/bin/ffprobe"} | ||||
export LD_LIBRARY_PATH=%%PREFIX%%/lib/emby-server/lib | |||||
pidfile="/var/run/%%PORTNAME%%.pid" | pidfile="/var/run/%%PORTNAME%%.pid" | ||||
procname="%%LOCALBASE%%/bin/mono" | procname="%%LOCALBASE%%/bin/mono" | ||||
command="/usr/sbin/daemon" | command="/usr/sbin/daemon" | ||||
command_args="-f -p ${pidfile} ${procname} %%PREFIX%%/lib/emby-server/system/EmbyServer.exe \ | command_args="-f -p ${pidfile} ${procname} %%PREFIX%%/lib/emby-server/system/EmbyServer.exe \ | ||||
-os freebsd \ | -os freebsd \ | ||||
-ffdetect ${%%RC_NAME%%_ffdetect} \ | |||||
-ffmpeg ${%%RC_NAME%%_ffmpeg} \ | -ffmpeg ${%%RC_NAME%%_ffmpeg} \ | ||||
-ffprobe ${%%RC_NAME%%_ffprobe} \ | -ffprobe ${%%RC_NAME%%_ffprobe} \ | ||||
-programdata ${%%RC_NAME%%_data_dir} \ | -programdata ${%%RC_NAME%%_data_dir} \ | ||||
-updatepackage emby-server-freebsd_{version}_amd64.txz" | -updatepackage emby-server-freebsd_{version}_amd64.txz" | ||||
start_precmd=%%RC_NAME%%_precmd | start_precmd=%%RC_NAME%%_precmd | ||||
%%RC_NAME%%_precmd() | %%RC_NAME%%_precmd() | ||||
{ | { | ||||
[ -f ${pidfile} ] || install -g ${%%RC_NAME%%_group} -o ${%%RC_NAME%%_user} -- /dev/null ${pidfile} | [ -f ${pidfile} ] || install -g ${%%RC_NAME%%_group} -o ${%%RC_NAME%%_user} -- /dev/null ${pidfile} | ||||
[ -d ${%%RC_NAME%%_data_dir} ] || install -d -g ${%%RC_NAME%%_group} -o ${%%RC_NAME%%_user} -- ${%%RC_NAME%%_data_dir} | [ -d ${%%RC_NAME%%_data_dir} ] || install -d -g ${%%RC_NAME%%_group} -o ${%%RC_NAME%%_user} -- ${%%RC_NAME%%_data_dir} | ||||
} | } | ||||
stop_postcmd=%%RC_NAME%%_postcmd | stop_postcmd=%%RC_NAME%%_postcmd | ||||
%%RC_NAME%%_postcmd() | %%RC_NAME%%_postcmd() | ||||
{ | { | ||||
rm -f ${pidfile} | rm -f ${pidfile} | ||||
} | } | ||||
run_rc_command "$1" | run_rc_command "$1" | ||||
PREFIX (Actually, you copied the typo.)