Skip to content
Snippets Groups Projects
Commit bf28bae6 authored by brinn's avatar brinn
Browse files

Add check.sh to do check of accessibility of the API.

SVN: 26623
parent 476aa66d
No related branches found
No related tags found
No related merge requests found
#! /bin/bash
# API access check script for CISD openBIS Application Server on Unix / Linux systems
# -----------------------------------------------------------------------------------
source `dirname "$0"`/setup-env
AWK=`awkBin`
printCheckResult()
{
if [ "$1" == "-q" ]; then
QUIET=1
fi
VAL=`curl --insecure --connect-timeout 10 https://localhost:8443/openbis/openbis/rmi-general-information-v1.json -H "Content-Type: application/json" -H "Accept: application/json" --data '{"id": "1", "jsonrpc": "2.0", "method": "getMinorVersion"}' 2> /dev/null | $AWK '/{"jsonrpc":"2.0","id":"1","result":[0-9]+}/ { print "OK" }'`
EVAL=$?
if [ $EVAL -eq 0 -a "$VAL" = "OK" ]; then
test -z "$QUIET" && echo "Check successful"
return 0
else
test -z "$QUIET" && echo "Check failed"
return 1
fi
}
printCheckResult "$1"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment