X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=squirrelmail-cn.git;a=blobdiff_plain;f=debian%2Fconfig;fp=debian%2Fconfig;h=8cb2686dbc2347239b9916bb7ff5c4dff78c8660;hp=0000000000000000000000000000000000000000;hb=e90ef71b190bd6b5802dfc42357c6c8dade3a5fa;hpb=821e3a1c91c5376cbd8a9c3a63a3f6bf07e935fb diff --git a/debian/config b/debian/config new file mode 100644 index 0000000..8cb2686 --- /dev/null +++ b/debian/config @@ -0,0 +1,58 @@ +#!/bin/sh + +set -e + +# Load debconf +. /usr/share/debconf/confmodule + +if [ "$1" != reconfigure ]; then + for item in leftwidth themecss; do + db_fget squirrelmail-cn/${item} seen + if [ "$RET" = "true" ]; then + exit 0 + fi + done +fi + +SMDIR="/etc/squirrelmail" +SMCONF="$SMDIR/config.php" +change_default=1 + + +# Check $default_left_size in SM's config.php +# +if [ -f "$SMCONF" ]; then + if egrep -q "^[[:space:]]*\\\$default_left_size[[:space:]]*=[[:space:]]*'220'" "$SMCONF"; then + change_default=0 + fi +fi +if [ $change_default -eq 1 ]; then + + # Ask user for changing $default_left_size to '220'. + db_input critical squirrelmail-cn/leftwidth || true + db_go || true +else + db_set squirrelmail-cn/leftwidth false || true + db_fset squirrelmail-cn/leftwidth seen true + change_default=1 +fi + +# Check $theme_css in SM's config.php +# +if [ -f "$SMCONF" ]; then + if egrep -q "^[[:space:]]*\\\$theme_css[[:space:]]*=[[:space:]]*SM_PATH[[:space:]]*\. +[[:space:]]*'themes\/css\/squirrelmail-cn\.css'" "$SMCONF"; then + change_default=0 + fi +fi +if [ $change_default -eq 1 ]; then + + # Ask user for changing $theme_css to 'squirrelmail-cn.css'. + db_input critical squirrelmail-cn/themecss || true + db_go || true +else + db_set squirrelmail-cn/themecss false || true + db_fset squirrelmail-cn/themecss seen true +fi + +exit 0