Kosmetik: Alignment
[kivitendo-erp.git] / DEBIAN / DEBIAN / config
1 #!/bin/sh
2
3 set -e
4 #set -x
5
6
7 # Source debconf library
8 . /usr/share/debconf/confmodule
9 db_version 2.0
10
11 echo "! config $STATE !" >> /tmp/lxo-erp.log
12
13 STATE=1
14 LASTSTATE=4
15 while [ "$STATE" != 0 ] && [ "$STATE" -le "$LASTSTATE" ]; do
16     echo "! config $STATE !" >> /tmp/lxo-erp.log
17     case "$STATE" in
18     1)
19             db_set lx-office-erp/admin-password-conf true || true
20         db_input high lx-office-erp/admin-password-conf || true
21             db_go || true
22             ;;
23         2)
24             db_get lx-office-erp/admin-password-conf 
25             if [ "$RET" = "true" ]; then
26                 db_input high lx-office-erp/admin-password || true
27                                 db_go || true
28                                 db_input high lx-office-erp/admin-password2 || true
29                                 db_go || true
30
31             fi
32            ;;
33         3)
34         db_get lx-office-erp/admin-password-conf 
35             if [ "$RET" = "true" ]; then
36                 db_get lx-office-erp/admin-password || true
37                 PASSPHRASE="$RET"
38                 db_get lx-office-erp/admin-password2 || true
39                 if [ "$RET" != "$PASSPHRASE" ]; then
40                     db_input high lx-office-erp/password-mismatch 
41                     db_reset lx-office-erp/admin-password || true
42                     db_reset lx-office-erp/admin-password2 || true
43                     db_fset lx-office-erp/admin-password seen false || true
44                     db_fset lx-office-erp/admin-password2 seen false || true
45                     STATE=1
46                 fi
47             fi
48             ;;
49         4)
50            db_input high lx-office-erp/lx-office-erp-user-postgresql-password || true
51            db_go || true
52            db_get lx-office-erp/lx-office-erp-user-postgresql-password || true
53            POSTGRESQLPWD="$RET"
54            if [ "#$POSTGRESQLPWD" != "#" ]; then
55                     db_input high lx-office-erp/lx-office-erp-user-postgresql-password2 || true
56                 db_go || true
57                 db_get lx-office-erp/lx-office-erp-user-postgresql-password2 || true
58             if [ "$RET" != "$POSTGRESQLPWD" ]; then
59                                         db_input high lx-office-erp/password-mismatch 
60                                         db_reset lx-office-erp/lx-office-erp-user-postgresql-password || true
61                                         db_reset lx-office-erp/lx-office-erp-user-postgresql-password2 || true
62                                         db_fset lx-office-erp/lx-office-erp-user-postgresql-password seen false || true
63                                         db_fset lx-office-erp/lx-office-erp-user-postgresql-password2 seen false || true
64                                         STATE=3
65                     fi
66            else
67                         db_input high lx-office-erp/password-empty || true
68                 db_go || true
69                         db_reset lx-office-erp/lx-office-erp-user-postgresql-password || true
70                         db_fset lx-office-erp/lx-office-erp-user-postgresql-password seen false || true
71                         STATE=3
72            fi
73
74            ;;
75         
76     esac
77
78     if db_go; then
79         STATE=$(($STATE + 1))
80     else
81         STATE=$(($STATE - 1))
82     fi
83 done