aports/testing/sonarr/sonarr.initd

34 lines
667 B
Bash

#!/sbin/openrc-run
# fallback values for /etc/conf.d/sonarr
: ${command_user:=sonarr:sonarr}
: ${directory:=/var/lib/sonarr}
: ${umask:=0002}
name=sonarr
description="Sonarr daemon"
command="/usr/lib/sonarr/bin/Sonarr"
command_args="-nobrowser -data=$directory"
command_background=true
pidfile="/run/$name.pid"
depend() {
need net
use dns logger netmount
}
start_pre() {
checkpath -d -o "$command_user" "$directory"
if [ -n "$logdir" ]; then
checkpath -d -o "$command_user" "$logdir"
fi
if [ -n "$output_log" ]; then
checkpath -f -o "$command_user" "$output_log"
fi
if [ -n "$error_log" ]; then
checkpath -f -o "$command_user" "$error_log"
fi
}