|
Lines 2-47
Link Here
|
| 2 |
# |
2 |
# |
| 3 |
# $FreeBSD: head/www/subsonic-standalone/files/subsonic.in 389352 2015-06-13 12:21:51Z jlh $ |
3 |
# $FreeBSD: head/www/subsonic-standalone/files/subsonic.in 389352 2015-06-13 12:21:51Z jlh $ |
| 4 |
# |
4 |
# |
| 5 |
|
|
|
| 6 |
# PROVIDE: subsonic |
5 |
# PROVIDE: subsonic |
| 7 |
|
6 |
# REQUIRE: LOGIN |
|
|
7 |
# KEYWORD: shutdown |
| 8 |
# |
8 |
# |
| 9 |
# Configuration settings for subsonic in /etc/rc.conf: |
9 |
# Configuration settings for subsonic in /etc/rc.conf: |
| 10 |
# |
10 |
# |
| 11 |
# subsonic_enable (bool): |
11 |
# subsonic_enable (bool): |
| 12 |
# Set to "NO" by default. |
12 |
# Set to "NO" by default. |
| 13 |
# Set it to "YES" to enable subsonic |
13 |
# Set it to "YES" to enable subsonic. |
| 14 |
# |
14 |
# |
| 15 |
# subsonic_home (str): |
15 |
# subsonic_home (str): |
| 16 |
# Set to "%%SUBSONIC_HOME%%" by default. |
16 |
# Set to "%%SUBSONIC_HOME%%" by default. |
| 17 |
# |
17 |
# |
| 18 |
# subsonic_music_folder (str): |
|
|
| 19 |
# Set to "%%SUBSONIC_HOME%%"/music by default. |
| 20 |
# |
| 21 |
# subsonic_playlist_folder (str): |
| 22 |
# Set to "%%SUBSONIC_HOME%%"/playlist by default. |
| 23 |
# |
| 24 |
# subsonic_pidfile (str): |
| 25 |
# Set to "${subsonic_home}/subsonic.pid" by default. |
| 26 |
# |
| 27 |
# subsonic_host (str): |
18 |
# subsonic_host (str): |
| 28 |
# Set to "0.0.0.0" by default. |
19 |
# Set to "0.0.0.0" by default. |
| 29 |
# Specify which IP address to listen to. |
20 |
# Specify which IP address to listen to. |
| 30 |
# |
21 |
# |
| 31 |
# subsonic_http_port (int): |
22 |
# subsonic_port (int): |
| 32 |
# Set to "4040" by default. |
23 |
# Set to "4040" by default. |
| 33 |
# Specify which port to listen on for HTTP. |
24 |
# Specify which port to listen on for HTTP(S). |
| 34 |
# |
25 |
# |
| 35 |
# subsonic_https_port (int): |
26 |
# subsonic_ssl (bool): |
| 36 |
# Set to "0" by default. |
27 |
# Set to "OFF" by default. |
| 37 |
# Specify which port to listen on for HTTPS. |
28 |
# Set it to "YES" to enable SSL. |
|
|
29 |
# |
| 30 |
# subsonic_ssl_keystore (str): |
| 31 |
# Optionally set path to custom SSL keystore. |
| 32 |
# |
| 33 |
# subsonic_ssl_password (str): |
| 34 |
# Optionally set password for custom SSL keystore. |
| 38 |
# |
35 |
# |
| 39 |
# subsonic_context_path (str): |
36 |
# subsonic_context_path (str): |
| 40 |
# Set to "/" by default. |
37 |
# Set to "/" by default. |
| 41 |
# Specify the last part of the Subsonic URL, typically "/" or "/subsonic". |
38 |
# Specify the last part of the Subsonic URL, typically "/" or "/subsonic". |
| 42 |
# |
39 |
# |
| 43 |
# subsonic_max_memory (int): |
40 |
# subsonic_max_memory (int): |
| 44 |
# Set to "100" by defaut. |
41 |
# Set to "100" by default. |
| 45 |
# Specify the memory limit (Java heap size) in megabytes. |
42 |
# Specify the memory limit (Java heap size) in megabytes. |
| 46 |
# |
43 |
# |
| 47 |
|
44 |
|
|
Lines 53-83
Link Here
|
| 53 |
|
50 |
|
| 54 |
load_rc_config "${name}" |
51 |
load_rc_config "${name}" |
| 55 |
|
52 |
|
| 56 |
eval "${rcvar}=\${${rcvar}:-'NO'}" |
53 |
: ${subsonic_enable:="NO"} |
| 57 |
eval "${name}_user=\${${name}_user:-'subsonic'}" |
54 |
: ${subsonic_user:="%%USER%%"} |
| 58 |
eval "${name}_group=\${${name}_group:-'subsonic'}" |
55 |
: ${subsonic_group:="%%GROUP%%"} |
| 59 |
eval "_subsonic_max_memory=\${${name}_max_memory:-'100'}" |
56 |
: ${subsonic_home:="%%SUBSONIC_HOME%%"} |
| 60 |
eval "_subsonic_home=\${${name}_home:-'%%SUBSONIC_HOME%%'}" |
57 |
: ${subsonic_host:="0.0.0.0"} |
| 61 |
eval "_subsonic_music_folder=\${${name}_music_folder:-'%%SUBSONIC_HOME%%/music'}" |
58 |
: ${subsonic_port:="4040"} |
| 62 |
eval "_subsonic_playlist_folder=\${${name}folder:-'%%SUBSONIC_HOME%%/playlist'}" |
59 |
: ${subsonic_ssl:="NO"} |
| 63 |
eval "_subsonic_host=\${${name}_host:-'0.0.0.0'}" |
60 |
: ${subsonic_context_path:="/"} |
| 64 |
eval "_subsonic_http_port=\${${name}_http_port:-'4040'}" |
61 |
: ${subsonic_max_memory:="100"} |
| 65 |
eval "_subsonic_https_port=\${${name}_https_port:-'0'}" |
62 |
|
| 66 |
eval "_subsonic_context_path=\${${name}_context_path:-'/'}" |
63 |
if checkyesno subsonic_ssl; then |
| 67 |
eval "_subsonic_pidfile=\${${name}_pidfile:-'%%SUBSONIC_HOME%%/subsonic.pid'}" |
64 |
SUBSONIC_SSL_FLAGS="-Dsubsonic.httpsPort=${subsonic_port}" && subsonic_port="0" |
| 68 |
pidfile="${_subsonic_pidfile}" |
65 |
if [ ! -z ${subsonic_ssl_keystore} ]; then |
| 69 |
|
66 |
SUBSONIC_SSL_FLAGS=${SUBSONIC_SSL_FLAGS}" -Dsubsonic.ssl.keystore=${subsonic_ssl_keystore} -Dsubsonic.ssl.password=${subsonic_ssl_password}" |
| 70 |
|
67 |
fi |
| 71 |
|
68 |
fi |
| 72 |
command="%%SUBSONIC_DIR%%/subsonic.sh" |
69 |
|
| 73 |
command_args="--home=${_subsonic_home} \ |
70 |
start_precmd="export LC_CTYPE='UTF-8'" |
| 74 |
--host=${_subsonic_host} \ |
71 |
subsonic_chdir="%%DATADIR%%" |
| 75 |
--port=${_subsonic_http_port} \ |
72 |
command="/usr/sbin/daemon" |
| 76 |
--https-port=${_subsonic_https_port} \ |
73 |
command_args="-f ${procname} \ |
| 77 |
--context-path=${_subsonic_context_path} \ |
74 |
-Dsubsonic.home=${subsonic_home} \ |
| 78 |
--max-memory=${_subsonic_max_memory} \ |
75 |
-Dsubsonic.host=${subsonic_host} \ |
| 79 |
--pidfile=${_subsonic_pidfile} \ |
76 |
-Dsubsonic.port=${subsonic_port} \ |
| 80 |
--default-music-folder=${_subsonic_music_folder} \ |
77 |
${SUBSONIC_SSL_FLAGS} \ |
| 81 |
--default-playlist-folder=${_subsonic_playlist_folder}" |
78 |
-Dsubsonic.contextPath=${subsonic_context_path} \ |
|
|
79 |
-Dsubsonic.defaultMusicFolder=${subsonic_home}/music \ |
| 80 |
-Dsubsonic.defaultPodcastFolder=${subsonic_home}/Podcast \ |
| 81 |
-Dsubsonic.defaultPlaylistFolder=${subsonic_home}/playlists \ |
| 82 |
-Xmx${subsonic_max_memory}m \ |
| 83 |
-Djava.awt.headless=true \ |
| 84 |
-jar ${subsonic_chdir}/subsonic-booter-jar-with-dependencies.jar" |
| 82 |
|
85 |
|
| 83 |
run_rc_command "$1" |
86 |
run_rc_command "$1" |