-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathcheck-grid.sh
More file actions
executable file
·34 lines (29 loc) · 740 Bytes
/
check-grid.sh
File metadata and controls
executable file
·34 lines (29 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# check-grid.sh
set -e
HOST="localhost"
PORT="4444"
declare -a extra_args
if [ -n "${SE_ROUTER_USERNAME}" ] && [ -n "${SE_ROUTER_PASSWORD}" ]; then
BASIC_AUTH="$(echo -en "${SE_ROUTER_USERNAME}:${SE_ROUTER_PASSWORD}" | base64 -w0)"
extra_args=(-H "Authorization: Basic ${BASIC_AUTH}")
fi
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 -skSL --noproxy "*" "${extra_args[@]}" ${SE_SERVER_PROTOCOL:-"http"}://${HOST}:${PORT}/wd/hub/status | jq -r '.value.ready' | grep -q "true" || exit 1