File: phpbb2-conf-mysql.config

package info (click to toggle)
phpbb2 2.0.21-6
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 4,224 kB
  • ctags: 12
  • sloc: sh: 476; makefile: 108; perl: 29; php: 21
file content (77 lines) | stat: -rw-r--r-- 1,825 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# config script for phpbb2
# Copyright 2004 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>

set -e

. /usr/share/debconf/confmodule

db_version 2.0
db_capb backup

# Flow of questions:
#
# prio | detail |  dbms  | dbsetup | Question(s)
# prio | T C M  | M P O  | C P N   |
# -----+--------+--------+-------- +-----
# High |  ASK   |        |         | detail
# Low  | - - x  |        |         | manual_warning
# High | - x -  |  ASK   |         | dbms
# High | - x -  | x x -  |   ASK   | dbsetup
###### | - x -  | - - x  |         | dbnosetup_warning
# Mix  | - x -  | x x x  | x x x   | dbinfo
# High | x x -  | x x -  | x - -   | dbrootpasswd

# Debconf's backup behaviour and seen behaviour makes a state machine almost
# impossible: seen flags are not update until after this script is finished,
# so reinjecting and trusting debconf to have unseen the previous question
# not gonna work -- too bad.

STATE=init
while [ "$STATE" != "finish" ]; do 
	case "$STATE" in
	init|dbsetup)
		db_input high phpbb2-conf-mysql/dbsetup || true
		db_go

		db_get phpbb2-conf-mysql/dbsetup || true
		if [ "$RET" = Populate ] || [ "$RET" = None ]; then
			DBSETUP=PN
		else
			DBSETUP=C
		fi
		STATE=dbinfo
		;;
	dbinfo)
		db_input medium   phpbb2-conf-mysql/dbserver || true
		db_input medium   phpbb2-conf-mysql/dbname   || true
		db_input medium   phpbb2-conf-mysql/dbuser   || true
		db_input low      phpbb2-conf-mysql/dbpass   || true
		if db_go; then
			if [ "$DBSETUP" = C ]; then
				STATE=dbrootpass
			else
				STATE=finish
			fi
		else
			STATE=init
		fi
		;;
	dbrootpass)
		db_get phpbb2-conf-mysql/db_created
		if [ "$RET" = "true" ]; then
			STATE=finish
			break
		fi
		db_input high phpbb2-conf-mysql/dbrootpass || true
		if db_go; then
			STATE=finish
		else
			STATE=init
		fi
		;;
	finish)
		;;
	esac
done