#!/sbin/openrc-run

# fallback values for /etc/conf.d/jackett
: ${command_user:=jackett:jackett}
: ${directory:=/var/lib/jackett}
: ${logdir:=/var/log/jackett}

name=jackett
description="Jackett daemon"
command="/usr/lib/jackett/jackett"
command_args="--NoUpdates --DataFolder=$directory"
command_background=true

pidfile="/run/$name.pid"
output_log="$logdir/output.log"
error_log="$logdir/error.log"

depend() {
	need net
	use dns logger netmount
}

start_pre() {
	checkpath -d -o "$command_user" "$directory" "$logdir"
	checkpath -f -o "$command_user" "$output_log" "$error_log"
}
