This commit is contained in:
krumel
2024-01-20 20:26:08 +00:00
parent f1e8c9aec0
commit fad036d559
16 changed files with 501 additions and 0 deletions

16
grafana/auto_restart.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
cd /home/admin/compose/grafana
response=$(curl --write-out '%{http_code}' --silent --output /dev/null https://grafana.krumel.moe)
if [[ $response -gt 500 ]] ; then
/usr/local/bin/docker-compose -f grafana.compose down > auto_restart.log 2>&1
/usr/local/bin/docker-compose -f grafana.compose up -d >> auto_restart.log 2>&1
sleep 1m
response=$(curl --write-out '%{http_code}' --silent --output /dev/null https://grafana.krumel.moe)
if [[ $response -gt 500 ]] ; then
echo "Auto Restart of Grafana/InfluxDB did not succeed, Status $response"
fi
fi