X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=squirrelmail-cn.git;a=blobdiff_plain;f=debian%2Fprerm;h=019ab2839962c1dc1b2effd348912adfd282b8ac;hp=80f154ea6aef3139b54e61cadcae05699ca24e06;hb=7c2ef7593bcaff86b987fdd7a311fa73a9fe180f;hpb=c27a02a6e5d0d09c40d14b6ed808d44fc5d25954 diff --git a/debian/prerm b/debian/prerm old mode 100644 new mode 100755 index 80f154e..019ab28 --- a/debian/prerm +++ b/debian/prerm @@ -2,38 +2,32 @@ set -e -case "$1" in - remove|deconfigure) - - cp-update -r squirrelmail-cn /etc/squirrelmail/apache.conf - - if [ -f /etc/apache2/conf.d/squirrelmail-cn.conf ]; then - rm -f /etc/apache2/conf.d/squirrelmail-cn.conf +PKG=squirrelmail-cn + +if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then + . /usr/share/apache2/apache2-maintscript-helper + + squirrelmail_enable() { + echo "CN: Disabling $PKG configuration for Apache2." + return 0 + } +else + echo "CN: Could not load Apache 2.4 maintainer script helper." + + squirrelmail_enable() { + return 1 + } +fi + +if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then + if [ -f /etc/squirrelmail/apache.conf ]; then + cp-update -r $PKG /etc/squirrelmail/apache.conf fi - # Restart Apache2 web server. - # - if apache2ctl configtest 2>/dev/null; then - invoke-rc.d apache2 force-reload || true - else - echo "CN: Your Apache2 configuration is either broken or nonexistant." + if squirrelmail_enable; then + apache2_invoke disconf $PKG fi - - break - ;; - upgrade) - : - ;; - failed-upgrade) - ;; - *) - echo "prerm called with unknown argument \$1'" >&2 - exit 0 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. +fi #DEBHELPER#