nextcloud-android/scripts/wait_for_server.sh
tobiasKaminsky d0f3a00637
drone/ updateScreenshot update
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2020-06-05 08:06:42 +02: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 50 ]]; then
echo "Failed to wait for server"
exit 1
fi
fi
let "checkcounter += 1"
sleep 10
done
echo "($checkcounter) Done"