This file is indexed.

config is in gwsetup 6.05.1-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
#!/bin/sh

set -e
# Some ideas stolen from the cvs package

# Config script for geneweb using debconf
. /usr/share/debconf/confmodule
db_version 2.0 || [ $? -lt 30 ]

# These will be used here and there below
INITFILE=/etc/init.d/gwsetup
DEFAULTPORT=2316
DEFAULTRUNMODE="Always on"
RCFILE=/etc/default/gwsetup

read_rcfile() {
    # Default values
    if [ -f $RCFILE ]; then
	PORT=$DEFAULTPORT
	RUN_MODE="$DEFAULTRUNMODE"
	. $RCFILE || true
    fi
}

set_debconf() {
    if [ "$RUN_MODE" ]; then
        db_set geneweb/run_mode "$RUN_MODE" || true
    fi
    if [ "$PORT" ]; then
        db_set geneweb/port "$PORT" || true
    fi
}

get_debconf() {
    db_get gwsetup/port
    PORT=$RET

    db_get gwsetup/run_mode
    RUN_MODE="$RET"
}


input_settings() {
    db_input low gwsetup/run_mode || true
    db_go
    db_get gwsetup/run_mode
    RUN_MODE=$RET
    # If not present, use default
    if [ -z "$RUN_MODE" ]
    then
	RUN_MODE="$DEFAULTRUNMODE"
    fi
    if [ "$RUN_MODE" = "Always on" ]
    then
	# These question will be asked only when running in daemon mode
	db_input low gwsetup/port || true
	db_go
    fi
}


## Main program
# We first read the settings file
# in order to get admin-modified settings
read_rcfile
# Debconf-stored values are updated accordingly
set_debconf
# They are re-read from Debconf
get_debconf
# In case the package has never been configured, the settings
# are asked through debconf
input_settings
# They are re-re-read from debconf
get_debconf