aboutsummaryrefslogtreecommitdiff
path: root/debian/anastasis-httpd.postrm
diff options
context:
space:
mode:
Diffstat (limited to 'debian/anastasis-httpd.postrm')
-rw-r--r--debian/anastasis-httpd.postrm72
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 @@
1#!/bin/sh
2
3set -e
4
5pathfind() {
6 OLDIFS="$IFS"
7 IFS=:
8 for p in $PATH; do
9 if [ -x "$p/$*" ]; then
10 IFS="$OLDIFS"
11 return 0
12 fi
13 done
14 IFS="$OLDIFS"
15 return 1
16}
17
18apache_remove() {
19 if [ diff /etc/anastasis/apache.conf /etc/apache2/conf-available/anastasis.conf ] >/dev/null 2>&1; then
20 rm -f /etc/apache2/conf-available/anastasis.conf
21 fi
22}
23
24nginx_remove() {
25 if [ diff /etc/taler-exchange/nginx.conf /etc/apache2/conf-available/taler-exchange.conf ] >/dev/null 2>&1; then
26 rm -f /etc/nginx/conf-available/anastasis.conf
27 fi
28}
29
30if [ -f /usr/share/debconf/confmodule ]; then
31 . /usr/share/debconf/confmodule
32fi
33
34if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
35 . /usr/share/dbconfig-common/dpkg/postrm.pgsql
36 dbc_go anastasis "$@"
37fi
38
39if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
40 if [ -f /usr/share/debconf/confmodule ]; then
41 . /usr/share/debconf/confmodule
42 db_version 2.0
43 db_get anastasis/reconfigure-webserver
44 webservers="$RET"
45 for webserver in $webservers; do
46 webserver=${webserver%,}
47 if [ "$webserver" = "nginx" ]; then
48 nginx_remove
49 else
50 apache_remove
51 fi
52 done
53 fi
54fi
55
56case "${1}" in
57purge)
58 rm -f /var/lib/anastasis/master-api-key.txt
59 rm -rf /var/lib/anastasis/httpd/
60 ;;
61remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear) ;;
62
63\
64 *)
65 echo "postrm called with unknown argument \`${1}'" >&2
66 exit 1
67 ;;
68esac
69
70#DEBHELPER#
71
72exit 0