| 1 |
#!/usr/bin/env bash |
| 2 |
|
| 3 |
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors |
| 4 |
# SPDX-FileCopyrightText: 2019-2020 Tobias Kaminsky <[email protected]> |
| 5 |
# SPDX-License-Identifier: AGPL-3.0-or-later |
| 6 |
|
| 7 |
counter=0 |
| 8 |
status="" |
| 9 |
|
| 10 |
until [[ $status = "false" ]]; do |
| 11 |
status=$(curl 2>/dev/null "http://$1/status.php" | jq .maintenance) |
| 12 |
|
| 13 |
echo "($counter) $status" |
| 14 |
|
| 15 |
if [[ "$status" =~ "false" || "$status" = "" ]]; then |
| 16 |
let "counter += 1" |
| 17 |
if [[ $counter -gt 90 ]]; then |
| 18 |
echo "Failed to wait for server" |
| 19 |
exit 1 |
| 20 |
fi |
| 21 |
fi |
| 22 |
|
| 23 |
sleep 10 |
| 24 |
done |
| 25 |
|