File: dbengine.postinst

package info (click to toggle)
dbengine 1.1-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 644 kB
  • ctags: 162
  • sloc: perl: 1,460; sql: 601; sh: 79; makefile: 43
file content (118 lines) | stat: -rw-r--r-- 3,317 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
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
#!/bin/sh -e
. /usr/share/debconf/confmodule

db_get dbengine/select_db

if [ "$RET" = "PostgreSQL" ] ; then
    DBASETYPE="postgres"
    PORT="5432"
    USER="postgres"
    DEFDB="template1"
elif [ "$RET" = "MySQL" ] ; then
    DBASETYPE="mysql"
    PORT="3306"
    USER="mysql"
    DEFDB="test"
else
    DBASETYPE="unconfigured"
    PORT="unconfigured"
    USER="unconfigured"
    DEFDB="unconfigured"
fi

if [ ! -e "/etc/dbengine.conf" ]; then
    cat <<EOF > /etc/dbengine.conf
[CONFIG]
# Database type (postgres,mysql,oracle)
dbasetype            $DBASETYPE

# Domain name of the server where your database lives (PostgreSQL/MySQL)
server               localhost

# Port number of the database server (PostgreSQL/MySQL)
port                 $PORT

# User to access database with (PostgreSQL/MySQL)
user                 $USER

# Password (if any) to access the database (PostgreSQL/MySQL)
passwd               

# Name of default database (PostgreSQL/MySQL) [/<access password>] (Oracle)]
defdb                $DEFDB

# Name of default database for display information (PostgreSQL/MySQL) [/<access password>] (Oracle)]
descdb               template1

# TWO_TASK environment variable (Oracle)
oraTWOTASK           

# ORACLE_SID environment variable (Oracle)
oraSID               CIS

# ORACLE_HOME environment variable (Oracle)
oraHOME              /opt/oracle/actual/product/8.0.5

# Absolute path to document-root directory of your WWW Server (ending slash required)
htdocs               /var/www/

# Absolute path to folder where dbengine.cgi will live (ending slash required)
abs_cgi              /usr/lib/cgi-bin/

# Absolute path to folder where template .html files are stored for processing (ending slash required)
templ                /usr/lib/cgi-bin/template/

# Absolute http path to folder for temporary .html files (ending slash required)tmp                  /tmp/

# Absolute http path to folder where dbengine.cgi lives (ending slash required)
cgis                 /cgi-bin/

# Language
language             english

# List output using tables (1: true - 0: false)
smarttable           1

# Maximum width of an automatically generated text field
maxwidth             45

# Optional path to optional background images (ending slash required)
#bgPath               /bgimages/

# Optional default extension for background images
#bgType               .jpeg

# Optional default background image for the table list page
#menuBackground       menuBG.jpeg

# Optional default background image for for generated pages
#mainBackground       mainBG.jpeg

# Background color for generated pages
bgcol                #C4DDFF

# Table header background color
headerbgcol          #555555

# Table header text color
headertxtcol         #FFFFFF

# Table item background color
tablebgcol           #CDC7C2

# Table item text color
tabletxtcol          #000000
EOF
else
    db_get dbengine/manage_config_with_debconf
    if [ "$RET" = true ]; then
        sed -e "s/^dbasetype.*/dbasetype            $DBASETYPE/; \
            s/^port.*/port                 $PORT/; \
            s/^user.*/user                 $USER/; \
            s/^defdb.*/defdb                $DEFDB/" \
            < /etc/dbengine.conf > /etc/dbengine.conf.new
        mv -f /etc/dbengine.conf.new /etc/dbengine.conf
    fi
fi

#DEBHELPER#