This file is indexed.

postrm is in cacti 1.1.38+ds1-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh

set -e

#
# Skip, if we are not in "remove" or "purge" state
# 
if [ "$1" != "remove" ] && [ "$1" != "purge" ]; then
    exit 0
fi

## Source debconf library
. /usr/share/debconf/confmodule
db_version 2.0
# source dbconfig-common stuff
if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
    . /usr/share/dbconfig-common/dpkg/postrm.mysql
    dbc_go cacti $@
fi


# update the webserver, if needed
# apache2
if [ -e /etc/apache2/conf.d/cacti.conf -o -e /etc/apache2/conf-enabled/cacti.conf ]; then
#   Sniplet adjusted from http://wiki.debian.org/Apache/PackagingFor24
    if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
	. /usr/share/apache2/apache2-maintscript-helper
	apache2_invoke disconf cacti
    elif  dpkg-query -f '${Version}'  -W 'apache2.2-common' > /dev/null 2>&1 ; then
	[ -h /etc/apache2/conf.d/cacti.conf ] && rm /etc/apache2/conf.d/cacti.conf
	invoke-rc.d apache2 reload || true
    fi
fi
# lighttpd
if which lighty-disable-mod >/dev/null 2>&1 ; then
    lighty-disable-mod cacti || true
#   We need to take care: bug #446324
    invoke-rc.d lighttpd reload 3>/dev/null || true
fi

#
# remove or purge the whole package
#
case "$1" in
    purge)
	# cleanup some unsed directores
	[ -d "/var/log/cacti" ] && rm -rf /var/log/cacti
	[ -d "/var/cache/cacti" ] && rm -rf /var/cache/cacti
	[ -d "/var/lib/cacti" ] && rm -rf /var/lib/cacti

	# get rid of configuration files and ucf entries
	for config_file in \
	    /etc/cacti/debian.php \
	    /etc/cacti/apache.conf \
	    /etc/cacti/lighttpd.conf \
	    /etc/apache2/conf-available/cacti.conf \
	    /etc/lighttpd/conf-available/cacti.conf \
	    /etc/lighttpd/conf-available/20-cacti.conf
	do
	    if which ucf >/dev/null 2>&1; then
		ucf --purge $config_file
	    fi
            if [ -x "`which ucfr 2>/dev/null`" ]; then
		ucfr --purge cacti $config_file
            fi
            for ext in .ucf-new .ucf-old .ucf-dist ""; do
		rm -f "$config_file$ext"
            done
	done
	;;

    remove)
	;;

esac

# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper dir_to_symlink /usr/share/cacti/site/include/js/themes /usr/share/javascript/jstree/themes 0.8.8h\+ds1-10\~ cacti -- "$@"
# End automatically added section
# Automatically added by dh_installdebconf/11.1.6ubuntu1
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section

exit 0