source: trunk/debian/config @ 888

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

removing debug code

RevLine 
[221]1#! /bin/sh
2
3set -e
4
5# Source debconf library.
6. /usr/share/debconf/confmodule
7db_title AlternC
8
[879]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
[852]13db_input critical alternc/welcomeconfirm || true
[802]14
[221]15db_go
16# Check the answer.
[713]17db_get alternc/welcomeconfirm || true
[221]18
19if [ "$RET" = "false" ]; then
[802]20        exit -1
[221]21fi
22
[622]23# default values for local.sh
[858]24MYSQL_HOST=localhost
[622]25MYSQL_DATABASE=alternc
26MYSQL_USER=sysusr
[879]27MYSQL_PASS="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..10)' `"
[884]28MYSQL_CLIENT=localhost
[879]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
[780]34NS1_HOSTNAME="$FQDN"
35NS2_HOSTNAME="$FQDN"
[879]36HOSTING="AlternC"
[780]37
[337]38if [ -r /etc/alternc/local.sh ]; then
[713]39    # source the current config
40    . /etc/alternc/local.sh
[362]41fi
[337]42
[624]43# mettre les valeurs de local.sh comme "default" pour debconf
[887]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
[782]53db_set alternc/desktopname "$FQDN"
[887]54fi
55
56db_get alternc/public_ip
57if [ -z "$RET" ]
58    then
[782]59db_set alternc/public_ip "$PUBLIC_IP"
[887]60fi
61
62db_get alternc/internal_ip
63if [ -z "$RET" ]
64    then
[782]65db_set alternc/internal_ip "$INTERNAL_IP"
[887]66fi
67
68db_get alternc/monitor_ip
69if [ -z "$RET" ]
70    then
[782]71db_set alternc/monitor_ip "$MONITOR_IP"
[887]72fi
73
74db_get alternc/ns1
75if [ -z "$RET" ]
76    then
[782]77db_set alternc/ns1 "$NS1_HOSTNAME"
[887]78fi
79
80db_get alternc/ns2
81if [ -z "$RET" ]
82    then
[782]83db_set alternc/ns2 "$NS2_HOSTNAME"
[887]84fi
85
86db_get alternc/bind_internal
87if [ -z "$RET" ]
88    then
[782]89db_set alternc/bind_internal "$BIND_INTERNAL"
[887]90fi
91
92db_get alternc/default_mx
93if [ -z "$RET" ]
94    then
[782]95db_set alternc/default_mx "$DEFAULT_MX"
[887]96fi
97
98db_get alternc/mysql/host
99if [ -z "$RET" ]
100    then
[782]101db_set alternc/mysql/host "$MYSQL_HOST"
[887]102fi
103
104db_get alternc/mysql/db
105if [ -z "$RET" ]
106    then
[782]107db_set alternc/mysql/db "$MYSQL_DATABASE"
[887]108fi
109
110db_get alternc/mysql/user
111if [ -z "$RET" ]
112    then
[782]113db_set alternc/mysql/user "$MYSQL_USER"
[887]114fi
115
116db_get alternc/mysql/password
117if [ -z "$RET" ]
118    then
[782]119db_set alternc/mysql/password "$MYSQL_PASS"
[887]120fi
121
122db_get alternc/mysql/client
123if [ -z "$RET" ]
124    then
[884]125db_set alternc/mysql/client "$MYSQL_CLIENT"
[887]126fi
127
128db_get alternc/alternc_location
129if [ -z "$RET" ]
130    then
[782]131db_set alternc/alternc_location "$ALTERNC_LOC"
[887]132fi
133
134db_get alternc/mynetwork
135if [ -z "$RET" ]
136    then
[782]137db_set alternc/mynetwork "$SMTP_RELAY_NETWORKS"
[887]138fi
[780]139
[326]140db_input medium alternc/desktopname || true
141db_input medium alternc/hostingname || true
[547]142db_input medium alternc/internal_ip || true
[538]143db_input medium alternc/public_ip || true
[362]144db_input medium alternc/default_mx || true
[326]145db_input medium alternc/ns1 || true
146db_input medium alternc/ns2 || true
[780]147db_input medium alternc/alternc_location || true
[535]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
[539]152db_input low alternc/monitor_ip || true
153db_input low alternc/bind_internal || true
154db_input low alternc/mynetwork || true
[326]155db_go
[713]156
157# vim: et sw=4
Note: See TracBrowser for help on using the repository browser.