You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/net-p2p/torrserver-bin/files/torrserver.initd

26 lines
646 B

#!/sbin/openrc-run
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
name="TorrServer"
description="TorrServer, stream torrent to http"
depend() {
need net
}
start() {
ebegin "Starting $name"
start-stop-daemon --start --exec /opt/torrserver/TorrServer-linux-amd64 \
--env HOME=/var/lib/torrserver --chdir /var/lib/torrserver \
--make-pidfile --pidfile /var/run/torrserver.pid \
--background --user torrserver:torrserver
eend $? "Failed to start $name"
}
stop() {
ebegin "Stopping $name"
start-stop-daemon --stop --pidfile /var/run/torrserver.pid
eend $? "Failed to stop $name"
}