2020-06-18 16:46:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-06-24 07:56:33 +02:00
|
|
|
# Ensure default assets are present.
|
|
|
|
while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/ &> /dev/null
|
2020-06-18 16:46:33 +02:00
|
|
|
|
2020-06-24 07:56:33 +02:00
|
|
|
# Ensure compatibility with previous version (config.yml was in the root directory)
|
|
|
|
if [ -f "/www/config.yml" ]; then
|
|
|
|
yes n | cp -i /www/config.yml /www/assets/ &> /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Install default config if no one is available.
|
|
|
|
yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null
|
|
|
|
|
2021-06-21 19:33:21 +02:00
|
|
|
# Create symbolic link for hosting in subfolder.
|
|
|
|
if [[ -n "${SUBFOLDER}" ]]; then
|
|
|
|
ln -s /www "/www/$SUBFOLDER"
|
|
|
|
chown -h $USER:$GROUP "/www/$SUBFOLDER"
|
|
|
|
fi
|
|
|
|
|
2020-07-09 19:47:33 +02:00
|
|
|
chown -R $UID:$GID /www/assets
|
2021-12-09 13:09:09 +01:00
|
|
|
|
|
|
|
echo "Starting webserver"
|
|
|
|
lighttpd -D -f /lighttpd.conf
|