2023-08-24 01:31:08 +02:00
|
|
|
#!/bin/sh
|
2023-08-25 03:50:05 +02:00
|
|
|
set -e
|
2023-08-24 01:31:08 +02:00
|
|
|
sed -i "s/ServerName.*/ServerName ${FOURGET_SERVER_NAME}/g" /etc/apache2/httpd.conf
|
|
|
|
sed -i "s/ServerAdmin.*/ServerAdmin ${FOURGET_SERVER_ADMIN_EMAIL}/g" /etc/apache2/httpd.conf
|
2023-09-22 23:20:39 +02:00
|
|
|
|
|
|
|
if [ ! -f /etc/4get/certs/cert.pem ] || [ ! -f /etc/4get/certs/chain.pem ] || [ ! -f /etc/4get/certs/privkey.pem ]; then
|
|
|
|
# remove SSL VirtualHost
|
|
|
|
echo "No certificate files detected. Listening on port 80"
|
|
|
|
sed -i '/<VirtualHost \*:443>/,/<\/VirtualHost>/d' /etc/apache2/httpd.conf
|
|
|
|
|
|
|
|
# prepend Listen 80 to /apache2/httpd.conf
|
|
|
|
echo "Listen 80" > /etc/apache2/httpd.conf_temp
|
|
|
|
cat /etc/apache2/httpd.conf >> /etc/apache2/httpd.conf_temp
|
|
|
|
mv /etc/apache2/httpd.conf_temp /etc/apache2/httpd.conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "4get is running"
|
2023-08-25 03:50:05 +02:00
|
|
|
exec httpd -DFOREGROUND
|
2023-09-22 23:20:39 +02:00
|
|
|
|