File: cyphesis-cpp.config

package info (click to toggle)
cyphesis-cpp 0.5.16-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,084 kB
  • ctags: 3,627
  • sloc: cpp: 30,418; python: 4,812; xml: 4,674; sh: 4,118; makefile: 902; ansic: 617
file content (60 lines) | stat: -rw-r--r-- 1,550 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

set -e

CONFFILE="/etc/cyphesis/cyphesis.vconf"

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

# set default values
DB_HOST="localhost"
DB_NAME="cyphesis"
DB_USER="cyphesis"
DB_PWD=""
USE_META="false"

# retrieve values from configfile (if present)
if test -f $CONFFILE ; then
    DB_HOST=`grep "^dbserver" $CONFFILE | sed -e 's/^dbserver.*\"\(.*\)\"/\1/'`
    DB_NAME=`grep "^dbname" $CONFFILE | sed -e 's/^dbname.*\"\(.*\)\"/\1/'`
    DB_USER=`grep "^dbuser" $CONFFILE | sed -e 's/^dbuser.*\"\(.*\)\"/\1/'`
    DB_PWD=`grep "^dbpasswd" $CONFFILE | sed -e 's/^dbpasswd.*\"\(.*\)\"/\1/'`
    USE_META=`grep "^usemetaserver" $CONFFILE | sed -e 's/^usemetaserver.*\"\(.*\)\"/\1/'`
fi

# set actual values
db_set cyphesis-cpp/postgresql/server $DB_HOST
db_set cyphesis-cpp/postgresql/database $DB_NAME
db_set cyphesis-cpp/postgresql/username $DB_USER
db_set cyphesis-cpp/postgresql/password $DB_PWD
db_set cyphesis-cpp/usemetaserver $USE_META

# questions about database connection
db_input high cyphesis-cpp/postgresql/note || true
db_go

db_input medium cyphesis-cpp/postgresql/local_server || true
db_go

db_get cyphesis-cpp/postgresql/local_server

if [ "x$RET" != xtrue ] ;
then

   db_input medium cyphesis-cpp/postgresql/server || true
   db_go

   db_input medium cyphesis-cpp/postgresql/database || true
   db_go

   db_input medium cyphesis-cpp/postgresql/username || true
   db_go

   db_input medium cyphesis-cpp/postgresql/password || true
   db_go

   db_input medium cyphesis-cpp/usemetaserver || true
   db_go

fi