docker-entrypoint.sh 535 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. set -e
  3. # remove quotes from variable if present
  4. FOURGET_PROTO="${FOURGET_PROTO%\"}"
  5. FOURGET_PROTO="${FOURGET_PROTO#\"}"
  6. if [ "$FOURGET_PROTO" = "https" ] || [ -f /etc/4get/certs/fullchain.pem ] || [ -f /etc/4get/certs/privkey.pem ]; then
  7. echo "Using https configuration"
  8. cp /etc/apache2/https.conf /etc/apache2/httpd.conf
  9. else
  10. echo "Using http configuration"
  11. cp /etc/apache2/http.conf /etc/apache2/httpd.conf
  12. fi
  13. php ./docker/gen_config.php
  14. echo "4get is running"
  15. exec httpd -DFOREGROUND