fix: fixed the problem of separating website
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
FROM debian
|
FROM debian
|
||||||
|
|
||||||
# Set required environment variables
|
# Set required environment variables
|
||||||
ENV WEBSITES='("google.com" "yahoo.com")'
|
ENV WEBSITES="google.com,yahoo.com"
|
||||||
ENV WEBHOOK_URL=""
|
ENV WEBHOOK_URL=""
|
||||||
ENV DISCORD_ID=""
|
ENV DISCORD_ID=""
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,11 @@ send_discord_notification() {
|
|||||||
"$WEBHOOK_URL"
|
"$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
|
# 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")
|
response=$(curl -s -o /dev/null -L -w "%{http_code}" --max-time 10 --connect-timeout 5 --insecure "$website")
|
||||||
|
|
||||||
if [ "$response" != "200" ]; then
|
if [ "$response" != "200" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user