diff --git a/DOCKERFILE b/DOCKERFILE index d445521..2340cb8 100644 --- a/DOCKERFILE +++ b/DOCKERFILE @@ -2,7 +2,7 @@ FROM debian # Set required environment variables -ENV WEBSITES='("google.com" "yahoo.com")' +ENV WEBSITES="google.com,yahoo.com" ENV WEBHOOK_URL="" ENV DISCORD_ID="" diff --git a/isalive.sh b/isalive.sh index a52c87a..709d790 100644 --- a/isalive.sh +++ b/isalive.sh @@ -9,8 +9,11 @@ send_discord_notification() { "$WEBHOOK_URL" } +# Split the comma-separated string of websites into a proper list +IFS=',' read -ra website_array <<< "$WEBSITES" + # Loop through the websites and check their status -for website in "${$WEBSITES[@]}"; do +for website in "${website_array[@]}"; do response=$(curl -s -o /dev/null -L -w "%{http_code}" --max-time 10 --connect-timeout 5 --insecure "$website") if [ "$response" != "200" ]; then