Tranzicijski paket za buduci prelazak na Debian Lenny.
[squirrelmail-cn.git] / debian / config
1 #!/bin/sh
2
3 set -e
4
5 # Load debconf
6 . /usr/share/debconf/confmodule
7
8 if [ "$1" != reconfigure ]; then
9         for item in leftwidth themecss; do
10             db_fget squirrelmail-cn/${item} seen
11             if [ "$RET" = "true" ]; then
12                 exit 0
13             fi
14         done
15 fi
16
17 SMDIR="/etc/squirrelmail"
18 SMCONF="$SMDIR/config.php"
19 change_default=1
20
21
22 # Check $default_left_size in SM's config.php
23 #
24 if [ -f "$SMCONF" ]; then
25         if egrep -q "^[[:space:]]*\\\$default_left_size[[:space:]]*=[[:space:]]*'220'" "$SMCONF"; then
26             change_default=0
27         fi
28 fi
29 if [ $change_default -eq 1 ]; then
30
31         # Ask user for changing $default_left_size to '220'.
32         db_input critical squirrelmail-cn/leftwidth || true
33         db_go || true
34 else
35         db_set squirrelmail-cn/leftwidth false || true
36         db_fset squirrelmail-cn/leftwidth seen true
37         change_default=1
38 fi
39
40 # Check $theme_css in SM's config.php
41 #
42 if [ -f "$SMCONF" ]; then
43         if egrep -q "^[[:space:]]*\\\$theme_css[[:space:]]*=[[:space:]]*SM_PATH[[:space:]]*\.
44 [[:space:]]*'themes\/css\/squirrelmail-cn\.css'" "$SMCONF"; then
45             change_default=0
46         fi
47 fi
48 if [ $change_default -eq 1 ]; then
49
50         # Ask user for changing $theme_css to 'squirrelmail-cn.css'.
51         db_input critical squirrelmail-cn/themecss || true
52         db_go || true
53 else
54         db_set squirrelmail-cn/themecss false || true
55         db_fset squirrelmail-cn/themecss seen true
56 fi
57
58 exit 0