source: trunk/debian/config @ 888

Revision 888, 3.3 KB checked in by benjamin, 7 years ago (diff)

removing debug code

Line 
1#! /bin/sh
2
3set -e
4
5# Source debconf library.
6. /usr/share/debconf/confmodule
7db_title AlternC
8
9# We don't reset the welcomeconfirm seen flag.
10#db_reset alternc/welcomeconfirm || true
11#db_fset alternc/welcomeconfirm "seen" "false" || true
12#db_set alternc/welcomeconfirm "true" || true
13db_input critical alternc/welcomeconfirm || true
14
15db_go
16# Check the answer.
17db_get alternc/welcomeconfirm || true
18
19if [ "$RET" = "false" ]; then
20        exit -1
21fi
22
23# default values for local.sh
24MYSQL_HOST=localhost
25MYSQL_DATABASE=alternc
26MYSQL_USER=sysusr
27MYSQL_PASS="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..10)' `"
28MYSQL_CLIENT=localhost
29FQDN="`cat /etc/mailname 2>/dev/null || cat /etc/hostname`"
30INTERNAL_IP="`/sbin/ifconfig|grep "inet addr:" | grep -v 127.0.0.1| head -1 | sed -e 's/^.*addr:\([0-9\.]*\).*$/\1/' 2>/dev/null || cat /etc/hostname`"
31PUBLIC_IP="$INTERNAL_IP"
32DEFAULT_MX="`cat /etc/mailname`"
33ALTERNC_LOC=/var/alternc
34NS1_HOSTNAME="$FQDN"
35NS2_HOSTNAME="$FQDN"
36HOSTING="AlternC"
37
38if [ -r /etc/alternc/local.sh ]; then
39    # source the current config
40    . /etc/alternc/local.sh
41fi
42
43# mettre les valeurs de local.sh comme "default" pour debconf
44db_get alternc/hostingname
45if [ -z "$RET" ]
46    then
47    db_set alternc/hostingname "$HOSTING"
48fi
49
50db_get alternc/desktopname
51if [ -z "$RET" ]
52    then
53db_set alternc/desktopname "$FQDN"
54fi
55
56db_get alternc/public_ip
57if [ -z "$RET" ]
58    then
59db_set alternc/public_ip "$PUBLIC_IP"
60fi
61
62db_get alternc/internal_ip
63if [ -z "$RET" ]
64    then
65db_set alternc/internal_ip "$INTERNAL_IP"
66fi
67
68db_get alternc/monitor_ip
69if [ -z "$RET" ]
70    then
71db_set alternc/monitor_ip "$MONITOR_IP"
72fi
73
74db_get alternc/ns1
75if [ -z "$RET" ]
76    then
77db_set alternc/ns1 "$NS1_HOSTNAME"
78fi
79
80db_get alternc/ns2
81if [ -z "$RET" ]
82    then
83db_set alternc/ns2 "$NS2_HOSTNAME"
84fi
85
86db_get alternc/bind_internal
87if [ -z "$RET" ]
88    then
89db_set alternc/bind_internal "$BIND_INTERNAL"
90fi
91
92db_get alternc/default_mx
93if [ -z "$RET" ]
94    then
95db_set alternc/default_mx "$DEFAULT_MX"
96fi
97
98db_get alternc/mysql/host
99if [ -z "$RET" ]
100    then
101db_set alternc/mysql/host "$MYSQL_HOST"
102fi
103
104db_get alternc/mysql/db
105if [ -z "$RET" ]
106    then
107db_set alternc/mysql/db "$MYSQL_DATABASE"
108fi
109
110db_get alternc/mysql/user
111if [ -z "$RET" ]
112    then
113db_set alternc/mysql/user "$MYSQL_USER"
114fi
115
116db_get alternc/mysql/password
117if [ -z "$RET" ]
118    then
119db_set alternc/mysql/password "$MYSQL_PASS"
120fi
121
122db_get alternc/mysql/client
123if [ -z "$RET" ]
124    then
125db_set alternc/mysql/client "$MYSQL_CLIENT"
126fi
127
128db_get alternc/alternc_location
129if [ -z "$RET" ]
130    then
131db_set alternc/alternc_location "$ALTERNC_LOC"
132fi
133
134db_get alternc/mynetwork
135if [ -z "$RET" ]
136    then
137db_set alternc/mynetwork "$SMTP_RELAY_NETWORKS"
138fi
139
140db_input medium alternc/desktopname || true
141db_input medium alternc/hostingname || true
142db_input medium alternc/internal_ip || true
143db_input medium alternc/public_ip || true
144db_input medium alternc/default_mx || true
145db_input medium alternc/ns1 || true
146db_input medium alternc/ns2 || true
147db_input medium alternc/alternc_location || true
148db_input low alternc/mysql/host || true
149db_input low alternc/mysql/db || true
150db_input low alternc/mysql/user || true
151db_input low alternc/mysql/password || true
152db_input low alternc/monitor_ip || true
153db_input low alternc/bind_internal || true
154db_input low alternc/mynetwork || true
155db_go
156
157# vim: et sw=4
Note: See TracBrowser for help on using the repository browser.