mirror of https://github.com/bastienwirtz/homer
feat(docker): skip assets install on permission error
parent
a40acb2fee
commit
3396257528
|
@ -1,17 +1,16 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PERMISSION_ERROR="Check assets directory permissions & docker user or skip default assets install by setting the INIT_ASSETS env var to 0"
|
# Default assets & example configuration installation
|
||||||
|
|
||||||
# Default assets & exemple configuration installation if possible.
|
|
||||||
if [[ "${INIT_ASSETS}" == "1" ]] && [[ ! -f "/www/assets/config.yml" ]]; then
|
if [[ "${INIT_ASSETS}" == "1" ]] && [[ ! -f "/www/assets/config.yml" ]]; then
|
||||||
echo "No configuration found, installing default config & assets"
|
echo "No configuration found, installing default config & assets"
|
||||||
if [[ ! -w "/www/assets/" ]]; then echo "Assets directory not writable. $PERMISSION_ERROR" && exit 1; fi
|
if [[ -w "/www/assets/" ]];
|
||||||
|
then
|
||||||
while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/ &> /dev/null
|
while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/
|
||||||
if [[ $? -ne 0 ]]; then echo "Fail to copy default assets. $PERMISSION_ERROR" && exit 1; fi
|
yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml
|
||||||
|
else
|
||||||
yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null
|
echo "Assets directory not writable, skipping default config install.";
|
||||||
if [[ $? -ne 0 ]]; then echo "Fail to copy default config file. $PERMISSION_ERROR" && exit 1; fi
|
echo "Check assets directory permissions & docker user or skip default assets install by setting the INIT_ASSETS env var to 0."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting webserver"
|
echo "Starting webserver"
|
||||||
|
|
Loading…
Reference in New Issue