nextcloud-android/scripts/wait_for_server.sh
tobiasKaminsky 7eb0f66079
Add circle support for searching / displaying
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2020-03-19 19:12:23 +01:00

23 lines
482 B
Bash
Executable file

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