File: bugzilla3.config

package info (click to toggle)
bugzilla 3.0.4.1-2%2Blenny2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,328 kB
  • ctags: 29
  • sloc: sh: 525; makefile: 160; perl: 98
file content (53 lines) | stat: -rw-r--r-- 1,428 bytes parent folder | download
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
#!/bin/bash -e

# Source debconf library.
. /usr/share/debconf/confmodule

# Source the dbconfig library only if dbconfig-common in installed
if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
    . /usr/share/dbconfig-common/dpkg/config.mysql
    dbc_go bugzilla3 $@
fi

# Establish the preliminaries.
db_version 2.0
db_capb backup

# Is the password known
db_fget bugzilla3/bugzilla_admin_pwd seen
if [ "$RET" = "true" ]; then
    db_get bugzilla3/bugzilla_admin_pwd || true
    db_set bugzilla3/pwd_check "$RET"
else
    db_set bugzilla3/pwd_check ""
fi

# prompt the user for values
db_beginblock
    db_input high bugzilla3/bugzilla_admin_name || true
    db_input high bugzilla3/bugzilla_admin_real_name || true
    if db_input high bugzilla3/bugzilla_admin_pwd || [ ! "$?" = "30" ] ; then  
        db_input high bugzilla3/pwd_check || true
    fi	
db_endblock

# refuse null values
if db_go; then
    for FIELD in bugzilla_admin_name bugzilla_admin_real_name; do
        db_get bugzilla3/$FIELD || true
        if [ "$RET" = "" ]; then
            #none of theres field should be empty
            db_reset bugzilla3/$FIELD
        fi
    done

    db_get bugzilla3/bugzilla_admin_pwd || true
    PWD=$RET
    db_get bugzilla3/pwd_check || true
    if [ "$RET" != "$PWD" ]; then
        db_reset bugzilla3/bugzilla_admin_pwd
        db_reset bugzilla3/pwd_check
        db_reset bugzilla3/pwd_check
    fi
fi