X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fprerm;h=dfeafa4cb3de9bce95e52597a242496fdb20b163;hb=6ef5e36518e02beb14bf1d93d74081dd33fc1cf8;hp=950fc167bd0ad9f87c52ce76c98e00a53a9d75ef;hpb=94d4b267e3c2220f29d665a71af4be63eeb5ee10;p=squirrelmail-change-pass-cn.git diff --git a/debian/prerm b/debian/prerm index 950fc16..dfeafa4 100644 --- a/debian/prerm +++ b/debian/prerm @@ -5,84 +5,70 @@ set -e case "$1" in remove|deconfigure) - # Include CARNet functions - . /usr/share/carnet-tools/functions.sh - - PKG="squirrelmail-change-pass-cn" - SQCONFDIR="/etc/squirrelmail" - SQCONF="$SQCONFDIR/config.php" - CPCONF="/usr/share/squirrelmail/plugins/change_pass/config.php" - 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 + # Include CARNet functions + . /usr/share/carnet-tools/functions.sh - # Remove SquirrelMail change_pass plugin from SquirrelMail - # configuration. - # - if egrep -q '^\$plugins\[[0-9]+\][\ ]*=[\ ]*'\''change_pass'\' "$SQCONF"; then - cp_echo "CN: Disabling SquirrelMail change_pass plugin in $SQCONF" - /usr/sbin/squirrelmail-configure --remove-plugin change_pass - fi + PKG="squirrelmail-change-pass-cn" + SQCONFDIR="/etc/squirrelmail" + SQCONF="$SQCONFDIR/config.php" + need_restart=0 - # Backup change_pass configuration file (if any) and notify user. - # - if [ -f "$CPCONF" ]; then - cp_echo "CN: Doing backup for $CPCONF" - cp_backup_conffile -d "/var/backups/$PKG" -p $CPCONF - cp_echo "CN: Backup is located in directory: /var/backups/$PKG/" - rm -f $CPCONF - rm -f $CPCONF.cn-old - cp_echo "CN: Configuration for SquirrelMail change_pass plugin has been removed." - fi + # 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 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 + # Remove SquirrelMail change_pass plugin from SquirrelMail + # configuration. + # + if egrep -q '^\$plugins\[[0-9]+\][\ ]*=[\ ]*'\''change_pass'\' "$SQCONF"; then + squirrelmail-configure --remove-plugin change_pass + fi - # Restart xinetd if needed. - # - if [ $need_restart -eq 1 ]; then + # 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 - 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 + # 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 - - # Mail root. - # - cp_mail "$PKG" + fi + fi - break - ;; + # Mail root. + # + cp_mail "$PKG" + + break + ;; upgrade) - : - ;; + : + ;; failed-upgrade) - ;; + ;; *) - echo "prerm called with unknown argument \$1'" >&2 - exit 0 - ;; + echo "prerm called with unknown argument \$1'" >&2 + exit 0 + ;; esac +#DEBHELPER# + exit 0