2020-06-18 16:46:33 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-04-10 11:55:11 +02:00
|
|
|
PERMISSION_ERROR="Check assets directory permissions & docker user or skip default assets install by setting the INIT_ASSETS env var to 0"
|
2020-06-18 16:46:33 +02:00
|
|
|
|
2022-04-10 11:55:11 +02:00
|
|
|
# Default assets & exemple configuration installation if possible.
|
2022-06-29 11:58:05 +02:00
|
|
|
if [[ "${INIT_ASSETS}" == "1" ]] && [[ ! -f "/www/assets/config.yml" ]]; then
|
2022-04-10 11:55:11 +02:00
|
|
|
echo "No configuration found, installing default config & assets"
|
|
|
|
if [[ ! -w "/www/assets/" ]]; then echo "Assets directory not writable. $PERMISSION_ERROR" && exit 1; fi
|
|
|
|
|
|
|
|
while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/ &> /dev/null
|
|
|
|
if [[ $? -ne 0 ]]; then echo "Fail to copy default assets. $PERMISSION_ERROR" && exit 1; fi
|
2020-06-24 07:56:33 +02:00
|
|
|
|
2022-04-10 11:55:11 +02:00
|
|
|
yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null
|
|
|
|
if [[ $? -ne 0 ]]; then echo "Fail to copy default config file. $PERMISSION_ERROR" && exit 1; fi
|
2021-06-21 19:33:21 +02:00
|
|
|
fi
|
|
|
|
|
2021-12-09 13:09:09 +01:00
|
|
|
echo "Starting webserver"
|
|
|
|
lighttpd -D -f /lighttpd.conf
|