diff options
Diffstat (limited to 'multimedia/jellyfin-bin/rc.jellyfin')
-rw-r--r-- | multimedia/jellyfin-bin/rc.jellyfin | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/multimedia/jellyfin-bin/rc.jellyfin b/multimedia/jellyfin-bin/rc.jellyfin new file mode 100644 index 0000000000..6af29237e2 --- /dev/null +++ b/multimedia/jellyfin-bin/rc.jellyfin @@ -0,0 +1,77 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: Jellyfin Media Server +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Jellyfin Media Server +# Description: Runs Jellyfin Media Server +### END INIT INFO + +# Load the defaults +. /etc/default/jellyfin + + +start() { +if [ -x /opt/jellyfin/jellyfin/jellyfin ]; then + if [ "$USER" = "" ]; then + echo "Starting Jellyfin Media Server" + /usr/bin/daemon --name=jellyfin --pidfile=/var/run/jellyfin.pid -- \ + /opt/jellyfin/jellyfin/jellyfin \ + -d $DATADIR \ + -C $CACHEDIR \ + -c $CONFIGDIR \ + -l $LOGDIR + else + echo "Starting Jellyfin Media Server" + /usr/bin/daemon --name=jellyfin --pidfile=/var/run/jellyfin.pid -- \ + /opt/jellyfin/jellyfin/jellyfin \ + -d $DATADIR \ + -C $CACHEDIR \ + -c $CONFIGDIR \ + -l $LOGDIR \ + -u $USER:$GROUP + fi +fi +} + +stop() { +echo "Stopping Jellyfin Media Server" +if /usr/bin/daemon --name=jellyfin --pidfile=/var/run/jellyfin.pid --running ; then + /usr/bin/daemon --name=jellyfin --pidfile=/var/run/jellyfin.pid --stop +fi +} + +restart() { +echo "Restarting Jellyfin Media Server" +if /usr/bin/daemon --name=jellyfin --pidfile=/var/run/jellyfin.pid --running ; then + /usr/bin/daemon --name=jellyfin --pidfile=/var/run/jellyfin.pid --restart + fi +} + +status() { +/usr/bin/daemon --name=jellyfin --running --pidfile=/var/run/jellyfin.pid --verbose +} + +case "$1" in +start) + start + ;; +stop) + stop + ;; +restart) + restart + ;; +status) + status + ;; +*) + echo $"Usage: $0 {start|stop|restart|status}" + exit 1 +esac + + + |