|
| |
6 |
6 |
db_version 2.0 |
|
| |
7 |
7 |
db_capb backup |
|
| |
8 |
8 |
|
|
| |
|
9 |
# Reset passwords if reconfigure |
|
| |
|
10 |
if [ "$1" = "reconfigure" ] ; then |
|
| |
|
11 |
db_reset dotlrn/dba_password |
|
| |
|
12 |
db_reset dotlrn/dba_confirm |
|
| |
|
13 |
db_reset dotlrn/dbu_password |
|
| |
|
14 |
db_reset dotlrn/dbu_confirm |
|
| |
|
15 |
fi |
|
| |
|
16 |
|
|
| |
9 |
17 |
STATE=1 |
|
| |
10 |
18 |
while [ "$STATE" != 0 -a "$STATE" != 13 ] |
|
| |
11 |
19 |
do |
|
|
| |
35 |
43 |
fi |
|
| |
36 |
44 |
;; |
|
| |
37 |
45 |
|
|
| |
38 |
|
3) |
|
| |
|
46 |
3) |
|
| |
39 |
47 |
db_input critical dotlrn/dba_password || true |
|
| |
40 |
48 |
if db_go; then |
|
| |
41 |
49 |
db_get dotlrn/dba_password || true |
|
|
| |
45 |
53 |
fi |
|
| |
46 |
54 |
;; |
|
| |
47 |
55 |
|
|
| |
48 |
|
4) |
|
| |
|
56 |
4) |
|
| |
49 |
57 |
db_input critical dotlrn/dba_confirm || true |
|
| |
50 |
58 |
if db_go; then |
|
| |
51 |
59 |
db_get dotlrn/dba_confirm || true |
|
| |
52 |
60 |
CONFIRM="$RET" |
|
| |
53 |
61 |
db_get dotlrn/dba_password || true |
|
| |
54 |
|
if [ "$RET" != "$CONFIRM" ]; then |
|
| |
|
62 |
if [ A"$RET" != A"$CONFIRM" ]; then |
|
| |
55 |
63 |
STATE=5 |
|
| |
56 |
64 |
else |
|
| |
57 |
65 |
STATE=6 |
|
|
| |
74 |
82 |
if [ ! -z "$RET" ]; then |
|
| |
75 |
83 |
STATE=7 |
|
| |
76 |
84 |
fi |
|
| |
77 |
|
pg_user="$RET" |
|
| |
78 |
85 |
else |
|
| |
79 |
86 |
STATE=2 |
|
| |
80 |
87 |
fi |
|
| |
81 |
88 |
;; |
|
| |
82 |
89 |
|
|
| |
83 |
|
7) |
|
| |
|
90 |
7) |
|
| |
84 |
91 |
db_input critical dotlrn/dbu_password || true |
|
| |
85 |
92 |
if db_go; then |
|
| |
86 |
93 |
db_get dotlrn/dbu_password || true |
|
|
| |
90 |
97 |
fi |
|
| |
91 |
98 |
;; |
|
| |
92 |
99 |
|
|
| |
93 |
|
8) |
|
| |
|
100 |
8) |
|
| |
94 |
101 |
db_input critical dotlrn/dbu_confirm || true |
|
| |
95 |
102 |
if db_go; then |
|
| |
96 |
103 |
db_get dotlrn/dbu_confirm || true |
|
| |
97 |
104 |
CONFIRM="$RET" |
|
| |
98 |
105 |
db_get dotlrn/dbu_password || true |
|
| |
99 |
|
if [ "$RET" != "$CONFIRM" ]; then |
|
| |
|
106 |
if [ A"$RET" != A"$CONFIRM" ]; then |
|
| |
100 |
107 |
STATE=9 |
|
| |
101 |
108 |
else |
|
| |
102 |
|
# Check if host is localhost, user is not www-data and password is not null, |
|
| |
|
109 |
# Check if host is localhost and password is not null, |
|
| |
103 |
110 |
# to change the postgresql access permissions properly. |
|
| |
104 |
|
if { [ "$pg_host" = "localhost" ] && [ "$pg_user" != "www-data" ]; } then |
|
| |
105 |
|
STATE=10 |
|
| |
106 |
|
if [ "A$RET" != "A" ]; then |
|
| |
|
111 |
if [ "$pg_host" = "localhost" ]; then |
|
| |
|
112 |
if [ A"$RET" != "A" ]; then |
|
| |
107 |
113 |
pg_pass_blank="false" |
|
| |
108 |
114 |
else |
|
| |
109 |
115 |
pg_pass_blank="true" |
|
| |
110 |
|
fi |
|
| |
|
116 |
fi |
|
| |
|
117 |
STATE=10 |
|
| |
111 |
118 |
else |
|
| |
112 |
119 |
STATE=11 |
|
| |
113 |
120 |
fi |