aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/qbittorrent/files/qbittorrent.in
blob: 943f55c643b2c85c35417abdf123afedf15b4819 (plain) (blame)
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
#!/bin/sh

# PROVIDE: qbittorrent
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# qbittorrent_enable:	     Set to NO by default. Set it to YES to enable it.
# qbittorrent_conf_dir:	     Directory where qbittorrent configuration
#			     data is stored.
#			     Default: /var/db/qbittorrent/conf
# qbittorrent_download_dir:  Directory to store downloaded data.
#			     Default: /var/db/qbittorrent/Downloads
# qbittorrent_user:	     The user account transmission daemon runs as.
#			     Default is 'qbittorrent'
# qbittorrent_group:	     The group associated with username qbittorrent
#			     daemon runs as. Default is 'qbittorrent'
#

. /etc/rc.subr

name=qbittorrent
rcvar=qbittorrent_enable

load_rc_config $name

: ${qbittorrent_enable="NO"}
: ${qbittorrent_conf_dir="/var/db/qbittorrent/conf"}
: ${qbittorrent_download_dir="/var/db/qbittorrent/Downloads"}
: ${qbittorrent_user=%%USER%%}
: ${qbittorrent_group=%%GROUP%%}

command="%%PREFIX%%/bin/qbittorrent-nox"
command_args="--daemon"

qbittorrent_flags=" \
	${qbittorrent_conf_dir:+--profile=${qbittorrent_conf_dir}} \
	${qbittorrent_download_dir:+--save-path=${qbittorrent_download_dir}} \
	${qbittorrent_flags}"

run_rc_command $1