]> git.immae.eu Git - github/bastienwirtz/homer.git/blame - entrypoint.sh
Bump follow-redirects from 1.15.2 to 1.15.4
[github/bastienwirtz/homer.git] / entrypoint.sh
CommitLineData
29d6b359
GT
1#!/bin/sh
2
049f8522 3PERMISSION_ERROR="Check assets directory permissions & docker user or skip default assets install by setting the INIT_ASSETS env var to 0"
29d6b359 4
049f8522 5# Default assets & exemple configuration installation if possible.
71d929a5 6if [[ "${INIT_ASSETS}" == "1" ]] && [[ ! -f "/www/assets/config.yml" ]]; then
049f8522
BW
7 echo "No configuration found, installing default config & assets"
8 if [[ ! -w "/www/assets/" ]]; then echo "Assets directory not writable. $PERMISSION_ERROR" && exit 1; fi
9
10 while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/ &> /dev/null
11 if [[ $? -ne 0 ]]; then echo "Fail to copy default assets. $PERMISSION_ERROR" && exit 1; fi
b102c9b2 12
049f8522
BW
13 yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null
14 if [[ $? -ne 0 ]]; then echo "Fail to copy default config file. $PERMISSION_ERROR" && exit 1; fi
caf5fae8
BG
15fi
16
b6b31e44 17echo "Starting webserver"
f62972f6 18exec lighttpd -D -f /lighttpd.conf