summaryrefslogtreecommitdiff
path: root/www/aria2/files/aria2.in
blob: cff45fdec88fce7e9b346646474dad55a659915c (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
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: aria2
# REQUIRE: NETWORKING
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable aria2:
#
# aria2_enable="YES"
#
# You can define flags for aria2 running. See aria2c(1) for details.
#

. /etc/rc.subr

name=aria2
rcvar=aria2_enable

command=%%PREFIX%%/bin/aria2c

# read configuration and set defaults
load_rc_config $name
aria2_enable=${aria2_enable:-"NO"}
aria2_config=${aria2_config:-"%%PREFIX%%/etc/aria2.conf"}
aria2_flags=${aria2_flags:-""}
aria2_user=${aria2_user:-"nobody"}
aria2_group=${aria2_group:-"nobody"}

required_files=${aria2_config}
command_args="-D --conf-path=${aria2_config} ${aria2_flags}"

run_rc_command "$1"