summaryrefslogtreecommitdiff
path: root/debian/taler-merchant.postrm
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-01-01 20:43:30 +0100
committerChristian Grothoff <christian@grothoff.org>2021-01-01 20:43:30 +0100
commitbfbbb5f8182fa668a992fadd504e43daa31962a4 (patch)
tree453f9dd82da615694193fac28cb028173597d412 /debian/taler-merchant.postrm
parent9bc5229ff2dce91cd941538d7c1907fcd1597064 (diff)
downloadmerchant-bfbbb5f8182fa668a992fadd504e43daa31962a4.tar.gz
merchant-bfbbb5f8182fa668a992fadd504e43daa31962a4.tar.bz2
merchant-bfbbb5f8182fa668a992fadd504e43daa31962a4.zip
improving Debian package (untested)
Diffstat (limited to 'debian/taler-merchant.postrm')
-rw-r--r--debian/taler-merchant.postrm62
1 files changed, 59 insertions, 3 deletions
diff --git a/debian/taler-merchant.postrm b/debian/taler-merchant.postrm
index 2564dff2..2cf6a941 100644
--- a/debian/taler-merchant.postrm
+++ b/debian/taler-merchant.postrm
@@ -15,18 +15,74 @@ pathfind() {
return 1
}
+apache_remove() {
+ if [ diff /etc/taler-merchant/apache.conf /etc/apache2/conf-available/taler-merchant.conf >/dev/null 2>&1 ];
+ then
+ rm -f /etc/apache2/conf-available/taler-merchant.conf
+ fi
+}
+
+nginx_remove() {
+ if [ diff /etc/taler-exchange/nginx.conf /etc/apache2/conf-available/taler-exchange.conf >/dev/null 2>&1 ];
+ then
+ rm -f /etc/nginx/conf-available/taler-merchant.conf
+ fi
+}
+
+if [ -f /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+fi
+
+if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
+ . /usr/share/dbconfig-common/dpkg/postrm.pgsql
+ dbc_go taler-merchant "$@"
+fi
+
+
+if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
+ if [ -f /usr/share/debconf/confmodule ]; then
+ db_version 2.0
+ db_get taler-merchant/reconfigure-webserver
+ webservers="$RET"
+ for webserver in $webservers; do
+ webserver=${webserver%,}
+ if [ "$webserver" = "nginx" ] ; then
+ nginx_remove
+ else
+ apache_remove
+ fi
+ done
+ fi
+fi
+
case "${1}" in
purge)
- if [ -e /usr/share/debconf/confmodule ]
+ if [ -e /usr/share/debconf/confmodule ]
then
. /usr/share/debconf/confmodule
db_version 2.0
+
+ db_get taler-merchant/username
+ _USERNAME="${RET:-taler-merchant-httpd}"
+
+ db_get taler-merchant/groupname
+ _GROUPNAME="${RET:-taler-merchant-httpd}"
else
+ _USERNAME="taler-merchant-httpd"
+ _GROUPNAME="taler-merchant-httpd"
fi
- ;;
- remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ if pathfind deluser
+ then
+ deluser --quiet --system ${_USERNAME} || true
+ fi
+ if pathfind delgroup
+ then
+ delgroup --quiet --system --only-if-empty ${_GROUPNAME} || true
+ fi
+ ;;
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)