From e250fd9ae38d5fe1ce05390b35c454e4d26daf26 Mon Sep 17 00:00:00 2001 From: bkellam Date: Sun, 29 Sep 2024 13:27:30 -0700 Subject: [PATCH] Handle remote configs in entrypoint.sh --- entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index bb73db23..09a4c8ef 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,8 +29,13 @@ if [ ! -f "$FIRST_RUN_FILE" ]; then fi # Fallback to sample config if a config does not exist -if [ ! -f "$CONFIG_PATH" ]; then - echo -e "\e[33m[Warning] Config file at CONFIG_PATH not found. Falling back on sample config.\e[0m" +if echo "$CONFIG_PATH" | grep -qE '^https?://'; then + if ! curl --output /dev/null --silent --head --fail "$CONFIG_PATH"; then + echo -e "\e[33m[Warning] Remote config file at '$CONFIG_PATH' not found. Falling back on sample config.\e[0m" + CONFIG_PATH="./sample-config.json" + fi +elif [ ! -f "$CONFIG_PATH" ]; then + echo -e "\e[33m[Warning] Config file at '$CONFIG_PATH' not found. Falling back on sample config.\e[0m" CONFIG_PATH="./sample-config.json" fi