From b337d7445be1e7e6e7f90e8ef8750439bfa5d621 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 13 Feb 2024 21:00:27 +0530 Subject: [PATCH] chore: fallback to localhost if public ip not found Signed-off-by: Pranav C --- docker-compose/setup-script/noco.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose/setup-script/noco.sh b/docker-compose/setup-script/noco.sh index d07dda8127..84a825600b 100755 --- a/docker-compose/setup-script/noco.sh +++ b/docker-compose/setup-script/noco.sh @@ -125,6 +125,11 @@ message_arr=() # extract public ip address PUBLIC_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) +# Check if the public IP address is not empty, if empty then use the localhost +if [ -z "$PUBLIC_IP" ]; then + PUBLIC_IP="localhost" +fi + # generate a folder for the docker-compose file which is not existing and do the setup within the folder # Define the folder name FOLDER_NAME="nocodb_$(date +"%Y%m%d_%H%M%S")"