#!/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" }