nextcloud-android/scripts/wait_for_server.sh
Álvaro Brey 0cb1cb0258
Chore: copy wait_for_server from library
Get rid of duplicated countr

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
2023-01-17 09:58:06 +01:00

20 lines
406 B
Bash
Executable file

#!/usr/bin/env bash
counter=0
status=""
until [[ $status = "false" ]]; do
status=$(curl 2>/dev/null "http://$1/status.php" | jq .maintenance)
echo "($counter) $status"
if [[ "$status" =~ "false" || "$status" = "" ]]; then
let "counter += 1"
if [[ $counter -gt 50 ]]; then
echo "Failed to wait for server"
exit 1
fi
fi
sleep 10
done