aegir-hostmaster.config 1.25 KB
Newer Older
1
2
3
4
5
6
7
#! /bin/sh

set -e

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

anarcat's avatar
anarcat committed
8
if [ "$DPKG_DEBUG" = "developer" ] || [ ! -z "$DEBUG" ]; then
9
10
11
    set -x
fi

anarcat's avatar
anarcat committed
12
if su -s /bin/sh aegir -c 'drush @hostmaster status' 2>&1 | grep -q 'Drupal bootstrap.*Successful'; then
13
    # there's already an install, do not go around asking silly questions
14
15
16
17
18
    db_fget aegir/makefile "seen" || true
    if [ "$RET" = "false" ]; then
        # ... except if that makefile question was never asked, in
        # which case we're probably upgrading from a custom install,
        # so we need to ask for the custom install makefile
19
        db_fset aegir/makefile "seen" "false" || true
20
21
22
        db_input medium aegir/makefile || true
        db_go
    fi
23
24
25
26
27
28
29
    exit 0
fi

db_get aegir/email
if [ -z "$RET" ]; then
   db_set aegir/email "aegir@`hostname -f`"
fi
anarcat's avatar
anarcat committed
30
db_get aegir/site
31
32
33
if [ -z "$RET" ]; then
    db_set aegir/site `hostname -f`
fi
anarcat's avatar
anarcat committed
34
35
db_input low aegir/email ||true
db_input high aegir/site || true
36
37
38
39
40
db_input low aegir/makefile || true
db_input low aegir/db_host || true
db_input low aegir/db_user || true
# if we got here, it means aegir is not installed and we forgot the
# root password, ask for it again
41
42
db_fset aegir/db_password "seen" "false" || true
db_input high aegir/db_password || true
43
db_go