#!/sbin/openrc-run
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

name="Jackett"
description="Jackett torrent tracker"

depend() {
	need net
}

start() {
	ebegin "Starting $name"
	start-stop-daemon --start --exec /opt/jackett/jackett \
		--env HOME=/var/jackett --chdir /var/jackett \
		--make-pidfile --pidfile /var/run/jackett.pid \
		--background --user jackett:jackett 
	eend $? "Failed to start $name"
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --pidfile /var/run/jackett.pid
	eend $? "Failed to stop $name"
}
