2018-11-09 18:37:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2018-11-18 19:12:55 +00:00
|
|
|
BUILD_VERSION={version}
|
|
|
|
UPDATER={updater}
|
|
|
|
|
2018-11-18 19:11:04 +00:00
|
|
|
if [ $1 = "abort-install" ]; then
|
|
|
|
# preinst was aborted, possibly due to NzbDrone still running.
|
|
|
|
# Nothing to do here
|
|
|
|
:
|
|
|
|
fi
|
|
|
|
|
|
|
|
# The bin directory is expected to be empty, unless the BuiltIn updater added files.
|
|
|
|
if [ $1 = "remove" ] && [ -d /usr/lib/sonarr/bin ]; then
|
|
|
|
rm -rf /usr/lib/sonarr/bin
|
2018-11-09 18:37:13 +00:00
|
|
|
fi
|
|
|
|
|
2018-11-18 19:12:55 +00:00
|
|
|
#BEGIN BUILTIN UPDATER
|
|
|
|
# Remove any existing patch if still present
|
|
|
|
if [ $1 = "remove" ] && [ -d /usr/lib/sonarr/bin_patch ]; then
|
|
|
|
rm -rf /usr/lib/sonarr/bin_patch
|
|
|
|
fi
|
|
|
|
#END BUILTIN UPDATER
|
|
|
|
|
2018-11-09 18:37:13 +00:00
|
|
|
# Purge the entire sonarr configuration directory.
|
|
|
|
# TODO: Maybe move a minimal backup to tmp?
|
2018-11-18 19:11:04 +00:00
|
|
|
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
|
2018-11-09 18:37:13 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
#DEBHELPER#
|