This file is indexed.

postrm is in sympa 6.1.7~dfsg-2.

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
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/sh

set -e

. /usr/share/debconf/confmodule
. /usr/share/dbconfig-common/dpkg/postrm
dbc_go sympa $@

case "$1" in
	remove)
		db_get sympa/use_soap || true
		use_soap="$RET"

		# Check whether the syslog configuration file is present in case
		# another system log daemon is used instead of syslog
		if [ -f /etc/sympa/facility ]; then
			if perl -ne '/(\S+)/ || exit 1; $ENV{facility}=$1; exit' /etc/sympa/facility \
			&& which syslog-facility >/dev/null 2>&1 \
			&& [ -e /etc/syslog.conf ] \
			&& syslog-facility remove "$facility" \
			&& [ -x /etc/init.d/sysklogd ]; then
				if which invoke-rc.d >/dev/null 2>&1; then
					invoke-rc.d sysklogd reload
				else
					etc/init.d/sysklogd reload
				fi
			fi
			rm -f /etc/sympa/facility
		fi

		if [ "$use_soap" = "true" ]; then
			# Remove Web server configuration
			db_get wwsympa/webserver_type
			webserver="$RET"

			case $webserver in
				"Apache 2")
				webserver="apache2"
				;;
				*)
				webserver="none"
				;;
			esac

			if [ "$use_soap" = "true" ]; then
				# Remove symbolic link to webserver configuration snippet
                link=$(readlink /etc/$webserver/conf.d/sympa-soap || true)
				if [ "$link" = "/etc/sympa/apache-soap" ]; then
					rm -f /etc/$webserver/conf.d/sympa-soap
				fi
			fi

			if [ $webserver != "none" ]; then
				# Restarting web server if it was requested at configuration time.
				db_get wwsympa/webserver_restart
				restart="$RET"

				if [ "$restart" = "true" ]; then
					if [ -x /etc/init.d/$webserver ]; then
						if which invoke-rc.d >/dev/null 2>&1; then
							invoke-rc.d $webserver force-reload
						else
							etc/init.d/$webserver force-reload
						fi
					fi
				# End up with debconf
				db_stop
				fi
			fi
		fi
		;;

	purge)
		db_input high wwsympa/remove_spool || true
		db_go
		db_get wwsympa/remove_spool
		remove_archives="$RET"

		if [ "$remove_archives" = "true" ]; then
			echo ""
			echo "Removing archives and spool subdirectories as requested ..."
			rm -rf /var/lib/sympa/wwsarchive 2>/dev/null || true
			rm -rf /var/spool/sympa/wws* 2>/dev/null || true
		fi

		# Delete the log files if purging, remove aliases too.
		rm -f /var/log/sympa.log*

		# Remove static content directory
		if [ -d /var/lib/sympa/static_content ]; then
			rm -r /var/lib/sympa/static_content
		fi

		if [ -f /etc/aliases ]; then
			sed -i -e '/#-- SYMPA begin/,/#-- SYMPA end/d' /etc/aliases
			newaliases || true
		fi

		rm -f /etc/sympa/cookie 2>/dev/null || true
		rm -f /etc/sympa/cookies.history

		# Remove configuration files
		rm -f /etc/sympa/data_structure.version
		rm -f /etc/sympa/sympa.conf
		rm -f /etc/sympa/wwsympa.conf

		# Try to remove if empty
		rmdir /etc/sympa 2>/dev/null || true

		db_input high sympa/remove_spool || true
		db_go
		db_get sympa/remove_spool
		remove_spool="$RET"

		if [ "$remove_spool" = "true" ]; then
			echo ""
			echo "Removing lists data and spool directory as requested ..."
			rm -rf /var/lib/sympa 2>/dev/null || true
			rm -rf /var/spool/sympa 2>/dev/null || true
		fi
		;;
esac

# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
	update-rc.d sympa remove >/dev/null
fi
# End automatically added section