2019-12-13 12:59:29 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-03-29 18:56:51 +03:00
|
|
|
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
# SPDX-FileCopyrightText: 2019-2020 Tobias Kaminsky <tobias@kaminsky.me>
|
2024-04-30 13:16:39 +03:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
2024-03-29 18:56:51 +03:00
|
|
|
|
2020-03-05 14:14:49 +03:00
|
|
|
counter=0
|
2023-01-17 11:58:06 +03:00
|
|
|
status=""
|
2019-12-13 12:59:29 +03:00
|
|
|
|
|
|
|
until [[ $status = "false" ]]; do
|
|
|
|
status=$(curl 2>/dev/null "http://$1/status.php" | jq .maintenance)
|
2023-01-17 11:58:06 +03:00
|
|
|
|
|
|
|
echo "($counter) $status"
|
2019-12-13 12:59:29 +03:00
|
|
|
|
|
|
|
if [[ "$status" =~ "false" || "$status" = "" ]]; then
|
|
|
|
let "counter += 1"
|
2020-04-28 18:39:39 +03:00
|
|
|
if [[ $counter -gt 50 ]]; then
|
2019-12-13 12:59:29 +03:00
|
|
|
echo "Failed to wait for server"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
sleep 10
|
|
|
|
done
|