#!/bin/sh # # Author: Michiel van Baak # # $FreeBSD: head/net-p2p/lidarr/files/lidarr.in 510043 2019-08-28 05:35:59Z pi $ # # PROVIDE: lidarr # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable lidarr: # lidarr_enable="YES" . /etc/rc.subr name="lidarr" rcvar=lidarr_enable load_rc_config $name : ${lidarr_enable="NO"} : ${lidarr_user:="lidarr"} : ${lidarr_data_dir:="%%PREFIX%%/lidarr"} pidfile="${lidarr_data_dir}/lidarr.pid" procname="%%PREFIX%%/bin/mono" command="/usr/sbin/daemon" command_args="-f ${procname} %%DATADIR%%/Lidarr.exe --nobrowser --data=${lidarr_data_dir}" start_precmd=lidarr_precmd lidarr_precmd() { export XDG_CONFIG_HOME=${lidarr_data_dir} if [ ! -d ${lidarr_data_dir} ]; then install -d -o ${lidarr_user} ${lidarr_data_dir} fi } run_rc_command "$1"