]> git.immae.eu Git - github/bastienwirtz/homer.git/blame - entrypoint.sh
Alias subfolder hosting
[github/bastienwirtz/homer.git] / entrypoint.sh
CommitLineData
29d6b359
GT
1#!/bin/sh
2
b102c9b2
BW
3# Ensure default assets are present.
4while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/ &> /dev/null
29d6b359 5
b102c9b2
BW
6# Ensure compatibility with previous version (config.yml was in the root directory)
7if [ -f "/www/config.yml" ]; then
8 yes n | cp -i /www/config.yml /www/assets/ &> /dev/null
9fi
10
11# Install default config if no one is available.
12yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null
13
caf5fae8
BG
14# Create symbolic link for hosting in subfolder.
15if [[ -n "${SUBFOLDER}" ]]; then
16 ln -s /www "/www/$SUBFOLDER"
17 chown -h $USER:$GROUP "/www/$SUBFOLDER"
18fi
19
fd9237eb 20chown -R $UID:$GID /www/assets
b6b31e44
K
21
22echo "Starting webserver"
23lighttpd -D -f /lighttpd.conf