2021-11-30 18:20:42 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z "$INSTANCE_ID" ]; then
|
|
|
|
echo "You need to provide an instance id."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "$INSTANCE_ID" > /var/www/domaincheck/index.html
|
|
|
|
|
2021-12-09 01:12:56 +08:00
|
|
|
if [ -z "$APACHE_PORT" ]; then
|
|
|
|
export APACHE_PORT="443"
|
|
|
|
fi
|
|
|
|
|
2022-07-18 01:30:34 +08:00
|
|
|
CONF_FILE="$(sed "s|ipv6-placeholder|\[::\]:$APACHE_PORT|" /etc/lighttpd/lighttpd.conf)"
|
|
|
|
echo "$CONF_FILE" > /etc/lighttpd/lighttpd.conf
|
|
|
|
|
2021-11-30 18:20:42 +08:00
|
|
|
# Check config file
|
|
|
|
lighttpd -tt -f /etc/lighttpd/lighttpd.conf
|
|
|
|
|
|
|
|
# Run server
|
|
|
|
lighttpd -D -f /etc/lighttpd/lighttpd.conf
|
|
|
|
|
|
|
|
exec "$@"
|