1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
#!/bin/sh -e
# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0
db_capb backup
db_input high moodle/sgbd || true
STATE=1
while [ "$STATE" != 0 -a "$STATE" != 13 ]
do
case "$STATE" in
1)
db_input critical moodle/webserver || true
if db_go; then
db_get moodle/webserver || true
if [ ! -z "$RET" ]; then
STATE=2
fi
else
STATE=0
fi
;;
2)
db_input critical moodle/db_server || true
if db_go; then
db_get moodle/db_server || true
if [ ! -z "$RET" ]; then
STATE=3
fi
else
STATE=1
fi
;;
3)
db_input critical moodle/db_host || true
if db_go; then
db_get moodle/db_host || true
if [ ! -z "$RET" ]; then
STATE=4
fi
else
STATE=2
fi
;;
4)
db_input critical moodle/dba_name || true
if db_go; then
db_get moodle/dba_name || true
if [ ! -z "$RET" ]; then
STATE=5
fi
else
STATE=2
fi
;;
5)
db_input critical moodle/dba_password || true
if db_go; then
db_get moodle/dba_password || true
STATE=6
else
STATE=4
fi
;;
6)
db_input critical moodle/dba_confirm || true
if db_go; then
db_get moodle/dba_confirm || true
CONFIRM="$RET"
db_get moodle/dba_password || true
if [ "$RET" != "$CONFIRM" ]; then
STATE=7
else
STATE=8
fi
else
STATE=3
fi
;;
7)
db_input critical moodle/mismatch || true
db_go
STATE=4
;;
8)
db_input critical moodle/dbu_name || true
if db_go; then
db_get moodle/dbu_name || true
if [ ! -z "$RET" ]; then
STATE=9
fi
else
STATE=2
fi
;;
9)
db_input critical moodle/dbu_password || true
if db_go; then
db_get moodle/dbu_password || true
STATE=10
else
STATE=8
fi
;;
10)
db_input critical moodle/dbu_confirm || true
if db_go; then
db_get moodle/dbu_confirm || true
CONFIRM="$RET"
db_get moodle/dbu_password || true
if [ "$RET" != "$CONFIRM" ]; then
STATE=11
else
STATE=12
fi
else
STATE=8
fi
;;
11)
db_input critical moodle/mismatch || true
db_go
STATE=8
;;
12)
db_input critical moodle/create_tables || true
db_go
STATE=13
;;
esac
done
if [ "$STATE" = 0 ]; then
db_input critical moodle/notconfigured || true
db_go
exit 1
fi
|