2 # postrm script for omd
4 # see: dh_installdeb(1)
8 # summary of how this script can be called:
11 # * <old-postrm> `upgrade' <new-version>
12 # * <new-postrm> `failed-upgrade' <old-version>
13 # * <new-postrm> `abort-install'
14 # * <new-postrm> `abort-install' <old-version>
15 # * <new-postrm> `abort-upgrade' <old-version>
16 # * <disappearer's-postrm> `disappear' <overwriter>
17 # <overwriter-version>
18 # for details, see http://www.debian.org/doc/debian-policy/ or
19 # the debian-policy package
21 APACHE_OMD_CONF
="/etc/apache2/conf.d/zzz_omd.conf"
22 APACHE_OMD_EMPTY_CONF
="/opt/omd/apache/empty.conf"
23 OMD
="omd-###OMD_VERSION###"
29 remove|failed-upgrade|abort-install|abort-upgrade|disappear
)
30 # update-alternatives --remove omd /omd/versions/###OMD_VERSION###
34 ALTERNATIVES
=`update-alternatives --list omd 2>/dev/null | egrep -v 'No alternatives'` ||
/bin
/true
35 if [ -z "$ALTERNATIVES" ]; then
36 echo "Removing system group 'omd'"
38 echo "Removing global links/directories"
39 # rm -f /usr/bin/omd # -> alternatives
40 # rm -f /usr/share/man/man8/omd.8.gz # -> alternatives
41 # rm -f /etc/init.d/omd # -> alternatives
42 rm -f /etc
/default
/omd
43 if test -d /etc
/apache
2/conf-available
; then
44 # On e.g. ubuntu 13.10 conf.d is not used anymore, use conf-available
45 APACHE_OMD_CONF
="/etc/apache2/conf-available/zzz_omd.conf"
47 ! test -x /usr
/sbin
/a2disconf || a2disconf zzz_omd
48 rm -f $APACHE_OMD_CONF $APACHE_OMD_EMPTY_CONF
50 # Try to remove empty directories
51 if test -d /opt
/omd
/versions
; then
52 rmdir --ignore-fail-on-non-empty /opt
/omd
/versions
54 if test -d /opt
/omd
/sites
; then
55 rmdir --ignore-fail-on-non-empty /opt
/omd
/sites
57 if test -d /opt
/omd
/apache
; then
58 rmdir --ignore-fail-on-non-empty /opt
/omd
/apache
60 if test -d /opt
/omd
; then
61 rmdir --ignore-fail-on-non-empty /opt
/omd
68 echo "postrm called with unknown argument \`$1'" >&2
73 # dh_installdeb will replace this with shell code automatically
74 # generated by other debhelper scripts.