summaryrefslogtreecommitdiff
path: root/docker/docker-entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/docker-entrypoint.sh')
-rwxr-xr-xdocker/docker-entrypoint.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh
index 0a41ddd..bdb706a 100755
--- a/docker/docker-entrypoint.sh
+++ b/docker/docker-entrypoint.sh
@@ -1,14 +1,23 @@
#!/bin/sh
set -e
-if [ ! -f /etc/4get/certs/fullchain.pem ] || [ ! -f /etc/4get/certs/privkey.pem ]; then
- echo "Using http configuration"
- cp /etc/apache2/http.conf /etc/apache2/httpd.conf
-else
+
+# remove quotes from variable if present
+FOURGET_PROTO="${FOURGET_PROTO%\"}"
+FOURGET_PROTO="${FOURGET_PROTO#\"}"
+
+# make lowercase
+FOURGET_PROTO=`echo $FOURGET_PROTO | awk '{print tolower($0)}'`
+
+
+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
-php82 ./docker/gen_config.php
+php ./docker/gen_config.php
echo "4get is running"