aboutsummaryrefslogtreecommitdiff
path: root/debian/postrm
diff options
context:
space:
mode:
authorJoshua Boniface <joshua@boniface.me>2019-01-05 19:55:55 -0500
committerJoshua Boniface <joshua@boniface.me>2019-01-05 22:31:22 -0500
commit177c4835a5403d47eab10cf597694d8f2567f25f (patch)
tree8d0155923a8ed002002b79e12e9b9e05cc510d19 /debian/postrm
parent3f65cb4f4882d63457192f1bc2f22eaeb9b035c9 (diff)
Add updated configurations for log and config dir
1. Add log and config flags to init and config 2. Move the existing logs and config dirs to the right places 3. Some cleanups in the control scripts 4. Prune the changelog of pre-Jellyfin entries
Diffstat (limited to 'debian/postrm')
-rw-r--r--debian/postrm25
1 files changed, 17 insertions, 8 deletions
diff --git a/debian/postrm b/debian/postrm
index 852841b163..cbf77325ee 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -2,7 +2,6 @@
set -e
NAME=jellyfin
-CONF_FILE=/etc/${NAME}.conf
DEFAULT_FILE=/etc/default/${NAME}
# Source Jellyfin default configuration
@@ -10,13 +9,10 @@ if [[ -f $DEFAULT_FILE ]]; then
. $DEFAULT_FILE
fi
-# Source Jellyfin user configuration overrides
-if [[ -f $CONF_FILE ]]; then
- . $CONF_FILE
-fi
-
-# Data directory where Jellyfin database, cache and logs are stored
-PROGRAMDATA=${JELLYFIN_DATA-/var/lib/$NAME}
+# Data directories for program data (cache, db), configs, and logs
+PROGRAMDATA=${JELLYFIN_DATA_DIRECTORY-/var/lib/$NAME}
+CONFIGDATA=${JELLYFIN_CONFIG_DIRECTORY-/etc/$NAME}
+LOGDATA=${JELLYFIN_DATA_DIRECTORY-/var/log/$NAME}
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
@@ -37,13 +33,26 @@ case "$1" in
deb-systemd-helper unmask jellyfin.service >/dev/null
fi
+ # Remove user and group
userdel jellyfin > /dev/null 2>&1 || true
delgroup --quiet jellyfin > /dev/null 2>&1 || true
+ # Remove config dir
+ if [[ -d $CONFIGDATA ]]; then
+ rm -rf $CONFIGDATA
+ fi
+ # Remove log dir
+ if [[ -d $LOGDATA ]]; then
+ rm -rf $LOGDATA
+ fi
+ # Remove program data dir
if [[ -d $PROGRAMDATA ]]; then
rm -rf $PROGRAMDATA
fi
+ # Remove binary symlink
[[ -f /usr/bin/jellyfin ]] && rm /usr/bin/jellyfin
+ # Remove sudoers config
[[ -f /etc/sudoers.d/jellyfin-sudoers ]] && rm /etc/sudoers.d/jellyfin-sudoers
+ # Remove /var/lib/jellyfin, just in case
[[ -d /var/lib/jellyfin ]] && rm -rf /var/lib/jellyfin
;;
remove)