Automatsko podesavanje minimalne duzine zaporke (8 znakova)
[squirrelmail-change-pass-cn.git] / debian / prerm
index 9827786..2f28968 100644 (file)
@@ -9,6 +9,9 @@ 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
@@ -24,13 +27,21 @@ case "$1" in
        # Remove SquirrelMail change_pass plugin from SquirrelMail
        # configuration.
        #
-       SQCONF=/etc/squirrelmail/config.php
-
        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