#!/bin/sh # prerm script for phpbb3 # # see: dh_installdeb(1) # # possible calls: remove, upgrade, failed-upgrade, deconfigure set -e if [ "$PB3DEBUG" = "maint" ]; then echo "[maint] $0 $@" >&2 fi if [ "$PB3DEBUG" = "sh" ]; then set -x fi . /usr/share/phpbb3/maint-libs/webapps-config . /usr/share/phpbb3/maint-libs/dbapps-lib . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/prerm case "$1" in remove|deconfigure) ## removal of webserver config analogous to postinst db_get phpbb3/httpd webservers="$RET" reload="" for webserver in $webservers; do webserver=${webserver%,} purge_webserver_config phpbb3 $webserver 50 reload_webserver phpbb3 $webserver done ;; upgrade) # purge the caches when up- (or down-) grading # (see also http://www.debian.org/doc/maint-guide/ch-update.en.html#s-upgrading) rm -Rf /var/cache/phpbb3/cache/* ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac dc_dbg dbc_go phpbb3 $@ dc_dbg #DEBHELPER#