#!/bin/sh set -e case "$1" in remove|deconfigure) # Include CARNet functions . /usr/share/carnet-tools/functions.sh PKG="squirrelmail-change-pass-cn" need_restart=0 # Remove CARNet configuration from /etc/hosts.allow and # /etc/hosts.deny. # if [ -f "/etc/hosts.allow" ]; then cp-update -r "$PKG" /etc/hosts.allow fi if [ -f "/etc/hosts.deny" ]; then cp-update -r "$PKG" /etc/hosts.deny fi # Remove SquirrelMail change_pass plugin from SquirrelMail # configuration. # SQCONF=/etc/squirrelmail/config.php cp_echo "CN: Disabling SquirrelMail change_pass plugin in $SQCONF" cp_check_and_sed '^\$plugins.*change_pass' \ '/^\$plugins.*change_pass/d' \ "$SQCONF" || true # Remove poppassd service from xinetd. # if [ -f "/etc/xinetd.d/poppassd" ]; then if egrep -q "^# Begin update by CARNet package " /etc/xinetd.d/poppassd; then cp_echo "CN: Removing poppassd service from xinetd configuration." rm -f /etc/xinetd.d/poppassd need_restart=1 fi fi # Restart xinetd if needed. # if [ $need_restart -eq 1 ]; then if [ -x "/etc/init.d/xinetd" ]; then if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d xinetd restart || exit $? else /etc/init.d/xinetd restart || exit $? fi fi fi # Mail root. # cp_mail "$PKG" break ;; upgrade) : ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \$1'" >&2 exit 0 ;; esac exit 0