1 #!/bin/sh
2 # postrm script for nagvis
3 #
4 # see: dh_installdeb(1)
6 set -e
8 # summary of how this script can be called:
9 # * <postrm> `remove'
10 # * <postrm> `purge'
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
22 case "$1" in
23 purge)
24 ## remove apache part of the configuration and nagvis' ini file
25 ## (both generetaded in postinst)
26 for conf_file in /etc/apache2/conf.d/nagvis.conf /etc/nagvis/nagvis.ini.php ; do
27 rm -f "$conf_file"
28 if which ucf >/dev/null; then
29 ucf --purge "$conf_file"
30 fi
31 if which ucfr >/dev/null; then
32 ucfr --purge nagvis "$conf_file"
33 fi
34 done
35 ## these files are generated by user interaction, ask if they should be removed
36 delete_on_purge="false"
37 if [ -f /usr/share/debconf/confmodule ]; then
38 . /usr/share/debconf/confmodule
39 db_input high nagvis/delete_on_purge || true
40 db_go || true
41 db_get nagvis/delete_on_purge || true
42 delete_on_purge="$RET"
43 fi
44 if [ "$delete_on_purge" = "true" ]; then
45 rm -f /etc/nagvis/auth.db
46 rm -rf /etc/nagvis/magps/*
47 rm -rf /var/cache/nagvis/*
48 fi
49 ;;
50 remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
51 ;;
53 *)
54 echo "postrm called with unknown argument \`$1'" >&2
55 exit 1
56 ;;
57 esac
59 # dh_installdeb will replace this with shell code automatically
60 # generated by other debhelper scripts.
62 #DEBHELPER#
64 exit 0