slackbuilds_ponce/multimedia/jellyfin-bin/rc.jellyfin
Ozan Türkyılmaz 7a4fb628fb
multimedia/jellyfin-bin: Added (Software Media System).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2023-07-08 16:40:41 +07:00

77 lines
1.5 KiB
Bash

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