postrm is in mailman3-web 0+20170523-14.
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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | #!/bin/sh
set -e
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
. /usr/share/dbconfig-common/dpkg/postrm
dbc_go mailman3-web "$@"
fi
if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
. /usr/share/apache2/apache2-maintscript-helper
fi
pathfind() {
OLDIFS="$IFS"
IFS=:
for p in $PATH; do
if [ -x "$p/$*" ]; then
IFS="$OLDIFS"
return 0
fi
done
IFS="$OLDIFS"
return 1
}
apache_remove() {
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
apache2_invoke disconf mailman3.conf
fi
if [ -d /etc/apache2/conf-available ] && [ -e /etc/apache2/conf-available/mailman3.conf ]; then
rm /etc/apache2/conf-available/mailman3.conf
fi
}
ngnx_remove() {
if [ -d /etc/nginx/sites-enabled ] && [ -e /etc/nginx/sites-enabled/mailman3 ]; then
rm -f /etc/nginx/sites-enabled/mailman3
rm -rf /var/log/nginx/mailman3
fi
}
case "$1" in
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
remove)
# Handling web server configuration
db_get mailman3-web/configure-webserver
webservers="$RET"
restart=""
for webserver in $webservers; do
webserver=${webserver%,}
case "$webserver" in
apache2)
apache_remove
;;
nginx)
nginx_remove
;;
esac
pathfind $webserver || continue
restart="$restart $webserver"
done
db_get mailman3-web/restart-webserver
res="$RET"
db_stop || true
if [ "$res" = "true" ]; then
for webserver in $restart; do
webserver=${webserver%,}
# Redirection of 3 is needed because Debconf uses it and it might
# be inherited by webserver. See bug #446324.
if pathfind invoke-rc.d; then
invoke-rc.d $webserver reload 3>/dev/null || true
else
/etc/init.d/$webserver reload 3>/dev/null || true
fi
done
fi
;;
purge)
if [ -f /usr/share/debconf/confmodule ]; then
db_purge
fi
rm -rf /var/lib/mailman3/web
rm -f /var/log/mailman3/web/mailman-web.log*
for ext in .ucf-new .ucf-old .ucf-dist ""; do
rm -f "/etc/mailman3/mailman-web.py$ext"
done
if which ucf >/dev/null 2>&1; then
ucf --purge /etc/mailman3/mailman-web.py
fi
if which ucfr >/dev/null 2>&1; then
ucfr --purge mailman3-web /etc/mailman3/mailman-web.py
fi
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Automatically added by dh_installinit/11.1.6ubuntu1
if [ "$1" = "purge" ] ; then
update-rc.d mailman3-web remove >/dev/null
fi
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installsystemd/11.1.6ubuntu1
if [ "$1" = "remove" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask 'mailman3-web.service' >/dev/null || true
fi
fi
if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge 'mailman3-web.service' >/dev/null || true
deb-systemd-helper unmask 'mailman3-web.service' >/dev/null || true
fi
fi
# 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
|