aboutsummaryrefslogtreecommitdiff
path: root/debian/jellyfin.init
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2018-12-09 22:28:41 -0500
committerGitHub <noreply@github.com>2018-12-09 22:28:41 -0500
commitafb78675b51dbe0795a4ea6e6c38fef0a6133133 (patch)
treeeec47fa5d639f72861529c23e9115b28198ffb25 /debian/jellyfin.init
parent49c67acf680a26ccde1a210faad5e22e8c395315 (diff)
parent0671bb5f44e9da594e1f5689a7ebdf425b19f5e5 (diff)
Merge pull request #11 from jellyfin/debian-packaging
Debian packaging 2.0
Diffstat (limited to 'debian/jellyfin.init')
-rw-r--r--debian/jellyfin.init44
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/jellyfin.init b/debian/jellyfin.init
new file mode 100644
index 000000000..4f23e13f0
--- /dev/null
+++ b/debian/jellyfin.init
@@ -0,0 +1,44 @@
+### BEGIN INIT INFO
+# Provides: Jellyfin Media Server
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Jellyfin Media Server
+# Description: Runs Jellyfin Server
+### END INIT INFO
+
+# Carry out specific functions when asked to by the system
+pid=`ps -fA|grep dotnet|grep JellyfinServer|awk '{print $2}'| tr -d '\n'`
+
+case "$1" in
+ start)
+ if [ "$pid" == "" ]; then
+ echo "Starting Jellyfin..."
+ nohup dotnet /usr/lib/jellyfin/bin/EmbyServer.dll >/dev/null 2>&1 &
+ else
+ echo "Jellyfin already running"
+ fi
+ ;;
+ stop)
+ if [ "$pid" != "" ]; then
+ echo "Stopping Jellyfin..."
+ kill $pid
+ sleep 2
+ else
+ echo "Jellyfin not running"
+ fi
+ ;;
+ status)
+ if [ "$pid" != "" ]; then
+ echo "Jellyfin running as $pid"
+ ps -f $pid
+ else
+ echo "Jellyfin is not running"
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 1
+ ;;
+esac