blob: 10216c9ea42c6f87959c03d54bfd2834be671b95 (
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
45
46
47
48
49
50
|
#!/bin/sh
#
# Author: Mark Felder <feld@FreeBSD.org>
#
# $FreeBSD$
#
# PROVIDE: jackett
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable jacket:
# jackett_enable="YES"
# Optionaly there is some other parameters
# jackett_user="jackett"
# jackett_group="jackett"
# jackett_data_dir="%%PREFIX%%/jackett"
#
. /etc/rc.subr
name="jackett"
rcvar=jackett_enable
load_rc_config $name
: ${jackett_enable="NO"}
: ${jackett_user:="jackett"}
: ${jackett_user:="jackett"}
: ${jackett_data_dir:="%%PREFIX%%/jackett"}
pidfile="${jackett_data_dir}/jackett.pid"
procname="%%PREFIX%%/bin/mono"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} ${procname} %%DATADIR%%/JackettConsole.exe -d ${jackett_data_dir}"
start_precmd=jackett_precmd
jackett_precmd()
{
export XDG_CONFIG_HOME=${jackett_data_dir}
# avoid root user warning
export USER=${jackett_user}
if [ ! -d ${jackett_data_dir} ]; then
install -d -o ${jackett_user} ${jackett_data_dir}
fi
}
run_rc_command "$1"
|