Unverified Commit deb02f21 authored by Marius Göcke's avatar Marius Göcke
Browse files

updated healthcheck

parent 2e4d2856
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
#!/bin/bash
set -o errexit
configfile="/Workspace/Configuration/Configuration.xml"
protocol=$(sed -n 's/.*exs:type="ns10:\(HTTP\|HTTPS\)".*/\1/p' $configfile)

protocol=$(sed -n 's/.*<Protocol[^>]*exs:type="ns[0-9]\+:\([^"]*\)".*/\1/p' $configfile)
protocol="${protocol,,}" # make protocol to lower
port=$(sed -n 's/.*Port="\([0-9]\+\)".*/\1/p' $configfile)
if [[ -z "$protocol" ]]; then
  echo "Protocol for healthcheck not available."
  exit 3
fi

port=$(sed -n 's/.*<Protocol[^>]*Port="\([^"]*\)".*/\1/p' $configfile)
if [[ -z "$port" ]]; then
  echo "Port for healthcheck not available."
  exit 4
fi

healthcheckcommand="curl --fail -v"
if [ "$protocol" == "https" ]; then
    healthcheckcommand="$healthcheckcommand --insecure"