2019-12-13 12:59:29 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
status=""
|
2020-03-05 14:14:49 +03:00
|
|
|
counter=0
|
|
|
|
checkcounter=0
|
2019-12-13 12:59:29 +03:00
|
|
|
|
|
|
|
until [[ $status = "false" ]]; do
|
|
|
|
status=$(curl 2>/dev/null "http://$1/status.php" | jq .maintenance)
|
2020-03-05 14:14:49 +03:00
|
|
|
echo "($checkcounter) $status"
|
2019-12-13 12:59:29 +03:00
|
|
|
|
|
|
|
if [[ "$status" =~ "false" || "$status" = "" ]]; then
|
|
|
|
let "counter += 1"
|
2020-01-23 08:52:25 +03:00
|
|
|
if [[ $counter -gt 10 ]]; then
|
2019-12-13 12:59:29 +03:00
|
|
|
echo "Failed to wait for server"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-03-05 14:14:49 +03:00
|
|
|
let "checkcounter += 1"
|
2019-12-13 12:59:29 +03:00
|
|
|
sleep 10
|
|
|
|
done
|
2020-03-05 14:14:49 +03:00
|
|
|
|
|
|
|
echo "($checkcounter) Done"
|