summaryrefslogtreecommitdiff
path: root/docker/docker-entrypoint.sh
blob: ca0c4bc31c11b78078342ad645c465e51b4c7ddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e

# remove quotes from variable if present
FOURGET_PROTO="${FOURGET_PROTO%\"}"
FOURGET_PROTO="${FOURGET_PROTO#\"}"

if [ "$FOURGET_PROTO" = "https" ] || [ -f /etc/4get/certs/fullchain.pem ] || [ -f /etc/4get/certs/privkey.pem ]; then
        echo "Using https configuration"
        cp /etc/apache2/https.conf /etc/apache2/httpd.conf
else
        echo "Using http configuration"
        cp /etc/apache2/http.conf /etc/apache2/httpd.conf
fi

php ./docker/gen_config.php


echo "4get is running"
exec httpd -DFOREGROUND