From 241c26e099a9ebda7386e42a5ccbee0365d1d825 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 17 Nov 2018 10:42:38 +0100 Subject: [PATCH] Purge should use the data folder as specified by debconf --- distribution/debian/postrm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/distribution/debian/postrm b/distribution/debian/postrm index 789d5b978..f6de262b4 100644 --- a/distribution/debian/postrm +++ b/distribution/debian/postrm @@ -9,9 +9,12 @@ fi # Purge the entire sonarr configuration directory. # TODO: Maybe move a minimal backup to tmp? -if [ "$1" = "purge" ]; then - if [ -d "/var/opt/sonarr" ]; then - rm -rf /var/opt/sonarr +if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_get sonarr/config_directory + CONFDIR="$RET" + if [ -d "$CONFDIR" ]; then + rm -rf "$CONFDIR" fi fi