Files
docker-selenium-grid/Base/check-grid.sh
Sagi Sarussi 91bb9c9ab9 Add -q to the grep (#1274)
Returns the status instead of the grepped pattern
2021-05-07 16:24:57 +02:00

31 lines
498 B
Bash
Executable File

#!/usr/bin/env bash
# check-grid.sh
set -e
HOST="localhost"
PORT="4444"
echoerr() { echo "$@" 1>&2; }
# process arguments
while [[ $# -gt 0 ]]
do
case "$1" in
--host)
HOST=${2:-"localhost"}
shift 2
;;
--port)
PORT=${2:-"4444"}
shift 2
;;
*)
echoerr "Unknown argument: $1"
exit 1
;;
esac
done
curl -sSL http://${HOST}:${PORT}/wd/hub/status | jq -r '.value.ready' | grep -q "true" || exit 1