diff options
| author | lolcat <will@lolcat.ca> | 2024-04-19 22:23:33 +0000 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2024-04-19 22:23:33 +0000 |
| commit | 9e18327df69542e07fad2ef471a3ebdbe9b08ae8 (patch) | |
| tree | b970a16d73e4a0f90a0e30228270c9d798fe79fd /docker/docker-entrypoint.sh | |
| parent | 55a093925fbcca4bbee38f1185a6ccb1584fd4c3 (diff) | |
| parent | e31b9494af16bf833d14b6256ca055fa94b6f77b (diff) | |
Merge pull request 'Docker update documentation, php, and modify gen_config.php' (#8) from docker_update_php into master
Reviewed-on: https://git.lolcat.ca/lolcat/4get/pulls/8
Diffstat (limited to 'docker/docker-entrypoint.sh')
| -rwxr-xr-x | docker/docker-entrypoint.sh | 19 |
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" |
