X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fprerm;h=2f2896897a5094f5832b864a68de293da8627f55;hb=849101efcfa61514aed2280735a17d8551bca5af;hp=11b8ed817ec16e36f7aecd771c6e9793671122cb;hpb=b32177d47e45255bada1b4588b16abcbcc3f6382;p=squirrelmail-change-pass-cn.git diff --git a/debian/prerm b/debian/prerm index 11b8ed8..2f28968 100644 --- a/debian/prerm +++ b/debian/prerm @@ -9,35 +9,46 @@ case "$1" in . /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 + if [ -f /etc/hosts.allow ]; then cp-update -r "$PKG" /etc/hosts.allow fi - if [ -f "/etc/hosts.deny" ]; then + 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 + 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 + + # 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 + rm -f $CPCONF + rm -f $CPCONF.cn-old + cp_echo "CN: Backup is located in directory: /var/backups/$PKG/" + fi # Remove poppassd service from xinetd. # - if [ -f "/etc/xinetd.d/poppassd" ]; then + 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." + cp_echo "CN: Removing poppassd service from xinetd configuration" rm -f /etc/xinetd.d/poppassd need_restart=1 fi