ddea8a605d3a89f15f72b275e929aa17e2237df1
[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
20
21 # Check $default_left_size in SM's config.php
22 #
23 change_default=1
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     # Ask user for changing $default_left_size to '220'.
31     db_input critical squirrelmail-cn/leftwidth || true
32     db_go || true
33 else
34     db_set squirrelmail-cn/leftwidth false || true
35     db_fset squirrelmail-cn/leftwidth seen true
36     change_default=1
37 fi
38
39 # Check $theme_css in SM's config.php
40 #
41 change_default=1
42 if [ -f "$SMCONF" ]; then
43     if egrep -q "^[[:space:]]*\\\$theme_css[[:space:]]*=[[:space:]]*SM_PATH[[:space:]]*\.[[:space:]]*'themes\/css\/squirrelmail-cn\.css'" "$SMCONF"; then
44         change_default=0
45     fi
46 fi
47 if [ $change_default -eq 1 ]; then
48     # Ask user for changing $theme_css to 'squirrelmail-cn.css'.
49     db_input critical squirrelmail-cn/themecss || true
50     db_go || true
51 else
52     db_set squirrelmail-cn/themecss false || true
53     db_fset squirrelmail-cn/themecss seen true
54 fi
55
56 exit 0