summaryrefslogtreecommitdiffstats
path: root/vagrant_support/bmo-configured
blob: 4d421577ba8fa7ace2f6c15c0d4b74066b8d4ede (plain)
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
#!/bin/bash

if [[ ! -f /vagrant/localconfig ]]; then
    echo "missing localconfig"
    exit 1
fi

if [[ ! -f /vagrant/data/params ]]; then
    echo "missing data/params"
    exit 1
fi

if grep -q "'urlbase' => ''" /vagrant/data/params; then
    echo "urlbase not configured"
    exit 1;
fi

if grep -q '$db_host.*localhost' /vagrant/localconfig; then
    echo "\$db_host not configured"
    exit 1
fi

for file in /vagrant/data/params /vagrant/index.cgi; do
    info="$(stat -c %U.%G "$file")"

    if [[ $info != "vagrant.apache" ]]; then
        echo "wrong file owner: $info $file"
        exit 1
    fi
done

cd /vagrant
sudo -u apache perl -T index.cgi &>/tmp/index.html || exit 1

grep -q skin-Dusk /tmp/index.html && exit 1

rm /tmp/index.html

exit 0