2023-08-23 23:31:08 +00:00
|
|
|
#!/bin/sh
|
2023-08-25 01:50:05 +00:00
|
|
|
set -e
|
2024-03-22 07:34:50 +00:00
|
|
|
|
|
|
|
# remove quotes from variable if present
|
|
|
|
FOURGET_PROTO="${FOURGET_PROTO%\"}"
|
|
|
|
FOURGET_PROTO="${FOURGET_PROTO#\"}"
|
|
|
|
|
2024-04-19 20:47:02 +00:00
|
|
|
# make lowercase
|
|
|
|
FOURGET_PROTO=`echo $FOURGET_PROTO | awk '{print tolower($0)}'`
|
|
|
|
|
2025-01-24 08:53:34 +00:00
|
|
|
FOURGET_SRC='/var/www/html/4get'
|
|
|
|
|
|
|
|
mkdir -p /etc/apache2
|
2024-04-19 20:47:02 +00:00
|
|
|
|
2024-04-24 23:11:49 +00:00
|
|
|
if [ "$FOURGET_PROTO" = "https" ]; then
|
2024-02-09 09:59:25 +00:00
|
|
|
echo "Using https configuration"
|
2025-01-24 08:53:34 +00:00
|
|
|
cp -r ${FOURGET_SRC}/docker/apache/https/httpd.conf /etc/apache2
|
|
|
|
cp -r ${FOURGET_SRC}/docker/apache/https/conf.d/* /etc/apache2/conf.d
|
|
|
|
|
2024-03-22 07:34:50 +00:00
|
|
|
else
|
|
|
|
echo "Using http configuration"
|
2025-01-24 08:53:34 +00:00
|
|
|
cp -r ${FOURGET_SRC}/docker/apache/http/httpd.conf /etc/apache2
|
|
|
|
cp -r ${FOURGET_SRC}/docker/apache/http/conf.d/* /etc/apache2/conf.d
|
2023-09-22 21:20:39 +00:00
|
|
|
fi
|
|
|
|
|
2024-03-22 07:34:50 +00:00
|
|
|
php ./docker/gen_config.php
|
2024-01-09 07:14:27 +00:00
|
|
|
|
2025-01-24 08:53:34 +00:00
|
|
|
if [ "$@" = "start" ]; then
|
|
|
|
echo "4get is running"
|
|
|
|
exec httpd -DFOREGROUND
|
|
|
|
else
|
|
|
|
exec "$@"
|
|
|
|
fi
|
2023-09-22 21:20:39 +00:00
|
|
|
|