diff options
author | Ozan Türkyılmaz <ozan.turkyilmaz@gmail.com> | 2023-07-08 10:11:03 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-07-08 16:40:41 +0700 |
commit | 7a4fb628fb516b5ad8ed21d4d77b6cc123591c3c (patch) | |
tree | 985bb888fb328cba1a8a643addeb01edbad3c1e2 /multimedia/jellyfin-bin/rc.jellyfin | |
parent | 8acb97f6a399d2bc1e52ad33d7934cf3ff4210f0 (diff) |
multimedia/jellyfin-bin: Added (Software Media System).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
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 0000000000000..6af29237e2e8f --- /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 + + + |