#!/bin/sh # # $FreeBSD: head/www/subsonic-standalone/files/subsonic.in 381942 2015-03-22 18:04:48Z jlh $ # # PROVIDE: subsonic # # Configuration settings for subsonic in /etc/rc.conf: # # subsonic_enable (bool): # Set to "NO" by default. # Set it to "YES" to enable subsonic # # subsonic_home (str): # Set to "%%SUBSONIC_HOME%%" by default. # # subsonic_music_folder (str): # Set to "%%SUBSONIC_HOME%%"/music by default. # # subsonic_playlist_folder (str): # Set to "%%SUBSONIC_HOME%%"/playlist by default. # # subsonic_pidfile (str): # Set to "${subsonic_home}/subsonic.pid" by default. # # subsonic_host (str): # Set to "0.0.0.0" by default. # Specify which IP address to listen to. # # subsonic_http_port (int): # Set to "4040" by default. # Specify which port to listen on for HTTP. # # subsonic_https_port (int): # Set to "0" by default. # Specify which port to listen on for HTTPS. # # subsonic_context_path (str): # Set to "/" by default. # Specify the last part of the Subsonic URL, typically "/" or "/subsonic". # # subsonic_max_memory (int): # Set to "100" by defaut. # Specify the memory limit (Java heap size) in megabytes. # . /etc/rc.subr case $0 in /etc/rc*) # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), # so get the name of the script from $_file name=$_file ;; *) name=$0 ;; esac name=${0##*/} rcvar=${name}_enable procname="%%JAVA%%" load_rc_config "${name}" eval "${rcvar}=\${${rcvar}:-'NO'}" eval "${name}_user=\${${name}_user:-'subsonic'}" eval "${name}_group=\${${name}_group:-'subsonic'}" eval "_subsonic_max_memory=\${${name}_max_memory:-'100'}" eval "_subsonic_home=\${${name}_home:-'%%SUBSONIC_HOME%%'}" eval "_subsonic_music_folder=\${${name}_music_folder:-'%%SUBSONIC_HOME%%/music'}" eval "_subsonic_playlist_folder=\${${name}folder:-'%%SUBSONIC_HOME%%/playlist'}" eval "_subsonic_host=\${${name}_host:-'0.0.0.0'}" eval "_subsonic_http_port=\${${name}_http_port:-'4040'}" eval "_subsonic_https_port=\${${name}_https_port:-'0'}" eval "_subsonic_context_path=\${${name}_context_path:-'/'}" eval "_subsonic_pidfile=\${${name}_pidfile:-'%%SUBSONIC_HOME%%/subsonic.pid'}" pidfile="${_subsonic_pidfile}" command="%%SUBSONIC_DIR%%/subsonic.sh" command_args="--home=${_subsonic_home} \ --host=${_subsonic_host} \ --port=${_subsonic_http_port} \ --https-port=${_subsonic_https_port} \ --context-path=${_subsonic_context_path} \ --max-memory=${_subsonic_max_memory} \ --pidfile=${_subsonic_pidfile} \ --default-music-folder=${_subsonic_music_folder} \ --default-playlist-folder=${_subsonic_playlist_folder}" run_rc_command "$1"