aboutsummaryrefslogtreecommitdiff
path: root/debian/preinst
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2018-12-09 18:45:25 -0500
committerGitHub <noreply@github.com>2018-12-09 18:45:25 -0500
commitc8c35864fe5dbf5027a2d1e682abd72654d309e8 (patch)
tree99e7ca13a3528cf5bfff074a5a2f94e6865faea9 /debian/preinst
parent811373aa86e42826b9937c750b6b307dc9fa6eaa (diff)
parent3557b90f100a6769ad8e6a50c804750c834d7510 (diff)
Merge pull request #10 from jellyfin/revert-9-debian-packaging
Revert "Debian packaging improvements"
Diffstat (limited to 'debian/preinst')
-rw-r--r--debian/preinst26
1 files changed, 13 insertions, 13 deletions
diff --git a/debian/preinst b/debian/preinst
index 7e168877e5..6431277967 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -1,22 +1,22 @@
#!/bin/bash
set -e
-NAME=jellyfin
+NAME=emby-server
CONF_FILE=/etc/${NAME}.conf
DEFAULT_FILE=/etc/default/${NAME}
-# Source Jellyfin default configuration
+# Source Emby server default configuration
if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE
fi
-# Source Jellyfin user configuration overrides
+# Source Emby server user configuration overrides
if [[ -f $CONF_FILE ]]; then
. $CONF_FILE
fi
# Data directory where Emby database, cache and logs are stored
-PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME}
+PROGRAMDATA=${EMBY_DATA-/var/lib/$NAME}
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
@@ -32,21 +32,21 @@ case "$1" in
elif [ -x "/etc/init.d/${NAME}" ] || [ -e "/etc/init/${NAME}.conf" ]; then
invoke-rc.d ${NAME} stop > /dev/null 2>&1 || true
fi
- # try and figure out if jellyfin is running
- PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "jellyfin*.pid" -print -quit)
- [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && JELLYFIN_PID=$(cat ${PIDFILE})
+ # try and figure out if emby is running
+ PIDFILE=$(find /var/run/ -maxdepth 1 -mindepth 1 -name "emby*.pid" -print -quit)
+ [[ -n "$PIDFILE" ]] && [[ -s "$PIDFILE" ]] && EMBY_PID=$(cat ${PIDFILE})
# if its running, let's stop it
- if [[ -n "$JELLYFIN_PID" ]]; then
- echo "Stopping Jellyfin!"
- # if jellyfin is still running, kill it
- if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then
- CPIDS=$(pgrep -P $JELLYFIN_PID)
+ if [[ -n "$EMBY_PID" ]]; then
+ echo "Stopping Emby Server!"
+ # if emby is still running, kill it
+ if [[ -n "$(ps -p $EMBY_PID -o pid=)" ]]; then
+ CPIDS=$(pgrep -P $EMBY_PID)
sleep 2 && kill -KILL $CPIDS
kill -TERM $CPIDS > /dev/null 2>&1
fi
sleep 1
# if it's still running, show error
- if [[ -n "$(ps -p $JELLYFIN_PID -o pid=)" ]]; then
+ if [[ -n "$(ps -p $EMBY_PID -o pid=)" ]]; then
echo "Could not successfully stop EmbyServer, please do so before uninstalling."
exit 1
else