.
This commit is contained in:
16
grafana/auto_restart.sh
Executable file
16
grafana/auto_restart.sh
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user