]> granicus.if.org Git - icinga2/blob - debian/icinga2-classicui.postrm
Fix the .bundle validation.
[icinga2] / debian / icinga2-classicui.postrm
1 #!/bin/sh
2 # postrm script for icinga2-common
3
4 set -e
5
6 # shorthand
7 en="/etc/icinga2/classicui"
8
9 . /usr/share/debconf/confmodule
10
11 # Apache2
12 disable_apache2() {
13     if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
14         echo "disabling Apache2 configuration ..."
15         . /usr/share/apache2/apache2-maintscript-helper
16         apache2_invoke disconf icinga2-classicui
17     fi
18     if [ -L /etc/apache2/conf.d/icinga-web.conf ]; then
19         echo "removing link /etc/apache2/conf.d/icinga2-classicui.conf ..."
20         # remove link to config
21         rm -f /etc/apache2/conf.d/icinga2-classicui.conf
22         # reload webserver
23         [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload || true
24     fi
25 }
26 case "$1" in
27     purge)
28         disable_apache2 "$@"
29         rm -f "$en/htpasswd.users"
30     ;;
31
32     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
33         disable_apache2 "$@"
34
35     ;;
36
37     *)
38         echo "postrm called with unknown argument \`$1'" >&2
39         exit 1
40     ;;
41 esac
42
43 #DEBHELPER#
44
45 exit 0