-# 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
+# Default assets & exemple configuration installation if possible.
+if [[ "${INIT_ASSETS}" == "1" ]] && [[ ! -f "/www/assets/config.yml" ]]; then
+ 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