I implemented the following dirty script on server-side.
Let me know if you have any ideas...
crontab -e (replace <dir>)
*/1 * * * * <dir>/corforum/CoRT/check.sh 2>&1
check.sh (replace <dir>)
#!/bin/bash
# Define the URL to check
URL="https://cort.cor-forum.de"
# Send a GET request to the URL and capture the HTTP status code
HTTP_STATUS=$(curl -o /dev/null -s -w "%{http_code}\n" $URL)
# Check if the HTTP status code is 200
if [ "$HTTP_STATUS" -ne 200 ]; then
echo "Site $URL is not reachable. Status code: $HTTP_STATUS"
echo "Restarting Docker Compose services..."
# Navigate to the Docker Compose directory
cd <dir> /corforum/CoRT
# Restart the Docker Compose services
docker compose restart
echo "Docker Compose services restarted."
else
echo "Site $URL is reachable. Status code: $HTTP_STATUS"
fi
I implemented the following dirty script on server-side.
Let me know if you have any ideas...
crontab -e
(replace<dir>
)check.sh
(replace<dir>
)