Lines 9-20
Link Here
|
9 |
# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to |
9 |
# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to |
10 |
# enable get_iplayer: |
10 |
# enable get_iplayer: |
11 |
# get_iplayer_enable (bool): Set to "NO" by default. |
11 |
# get_iplayer_enable (bool): Set to "NO" by default. |
12 |
# get_iplayer_chdir (string): Set to "/tmp" by default; this is where |
|
|
13 |
# downloaded files are stored. Should be writable |
14 |
# by get_iplayer user. |
15 |
# get_iplayer_flags (string): Set to "" by default. |
12 |
# get_iplayer_flags (string): Set to "" by default. |
16 |
# get_iplayer_bind_port (number): Set to 9370 by default. |
13 |
# get_iplayer_logfile (string): Server info messages logfile. Set to "" |
17 |
# get_iplayer_listen_address (IP address): Set to 127.0.0.1 by default. |
14 |
# (no logging) by default. |
|
|
15 |
# get_iplayer_chdir (string): Set to the "get_iplayer" home directory |
16 |
# by default; this is where downloaded |
17 |
# files are stored. It should be |
18 |
# writeable by the get_iplayer user. |
19 |
# get_iplayer_listen_address |
20 |
# (IP address): Set to 127.0.0.1 by default. |
21 |
# get_iplayer_bind_port |
22 |
# (number): Set to 9370 by default. |
18 |
# |
23 |
# |
19 |
########################################################## |
24 |
########################################################## |
20 |
## WARNING: |
25 |
## WARNING: |
Lines 34-46
Link Here
|
34 |
load_rc_config $name |
39 |
load_rc_config $name |
35 |
|
40 |
|
36 |
: ${get_iplayer_enable:=NO} |
41 |
: ${get_iplayer_enable:=NO} |
37 |
: ${get_iplayer_bind_port=9370} |
42 |
: ${get_iplayer_flags=""} |
|
|
43 |
: ${get_iplayer_chdir="$(pw usershow get_iplayer | awk -F: '{print $9}')"} |
38 |
: ${get_iplayer_listen_address=127.0.0.1} |
44 |
: ${get_iplayer_listen_address=127.0.0.1} |
39 |
: ${get_iplayer_chdir=/tmp} |
45 |
: ${get_iplayer_bind_port=9370} |
40 |
|
46 |
|
|
|
47 |
get_iplayer_logfile="${get_iplayer_logfile:+"-o $get_iplayer_logfile"}" |
48 |
|
41 |
command=/usr/sbin/daemon |
49 |
command=/usr/sbin/daemon |
42 |
command_args="-f -u ${name} -p /var/run/${name}/${name}.pid %%WWWDIR%%/${name}.cgi -p ${get_iplayer_bind_port} -l ${get_iplayer_listen_address} --getiplayer %%WWWDIR%%/${name}" |
50 |
export HOME="$get_iplayer_chdir" |
43 |
procname=/usr/bin/perl |
51 |
cd "$HOME" || exit 1 |
|
|
52 |
command_args="-f ${get_iplayer_logfile} -u ${name} -p /var/run/${name}/${name}.pid %%WWWDIR%%/${name}.cgi -p ${get_iplayer_bind_port} -l ${get_iplayer_listen_address} --getiplayer %%WWWDIR%%/${name} ${get_iplayer_flags}" |
53 |
get_iplayer_flags="" # This is needed to stop the flags being applied to the 'daemon' program. |
54 |
procname=/usr/local/bin/perl |
44 |
pidfile=/var/run/${name}/${name}.pid |
55 |
pidfile=/var/run/${name}/${name}.pid |
45 |
|
56 |
|
46 |
start_precmd="install -d -o ${name} -m755 /var/run/${name}" |
57 |
start_precmd="install -d -o ${name} -m755 /var/run/${name}" |