diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-07-30 10:38:27 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-07-30 10:38:27 +0200 |
commit | 7e669bcf6b6336ec429da949bcb4aa456971dba2 (patch) | |
tree | d19912f950d1cac1c38b857b7d5bdaba2289544e /debian/anastasis-httpd.postrm | |
download | anastasis-7e669bcf6b6336ec429da949bcb4aa456971dba2.tar.gz anastasis-7e669bcf6b6336ec429da949bcb4aa456971dba2.tar.bz2 anastasis-7e669bcf6b6336ec429da949bcb4aa456971dba2.zip |
folding history in preparation of GNU Anastasis v0.0.0 release
Diffstat (limited to 'debian/anastasis-httpd.postrm')
-rw-r--r-- | debian/anastasis-httpd.postrm | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/debian/anastasis-httpd.postrm b/debian/anastasis-httpd.postrm new file mode 100644 index 0000000..fc96f0e --- /dev/null +++ b/debian/anastasis-httpd.postrm @@ -0,0 +1,72 @@ +#!/bin/sh + +set -e + +pathfind() { + OLDIFS="$IFS" + IFS=: + for p in $PATH; do + if [ -x "$p/$*" ]; then + IFS="$OLDIFS" + return 0 + fi + done + IFS="$OLDIFS" + return 1 +} + +apache_remove() { + if [ diff /etc/anastasis/apache.conf /etc/apache2/conf-available/anastasis.conf ] >/dev/null 2>&1; then + rm -f /etc/apache2/conf-available/anastasis.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/anastasis.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 anastasis "$@" +fi + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_version 2.0 + db_get anastasis/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) + rm -f /var/lib/anastasis/master-api-key.txt + rm -rf /var/lib/anastasis/httpd/ + ;; +remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear) ;; + +\ + *) + echo "postrm called with unknown argument \`${1}'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 |