Skip to content

Commit

Permalink
fixup wait_for_uaa bash
Browse files Browse the repository at this point in the history
- quote vars to prevent globbing
- portable shebang
- strict mode bash

fixes #30

[#162468758]
  • Loading branch information
joshzarrabi committed Jul 23, 2019
1 parent 6de26be commit d132fff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jobs/credhub/templates/wait_for_uaa.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

<% if p("credhub.authentication.uaa.enabled") %>
<% if p("credhub.authentication.uaa.wait_for_start") %>
status=`curl --max-time 5 --connect-timeout 2 -k --silent <%= p(["credhub.authentication.uaa.internal_url", "credhub.authentication.uaa.url"]) %>/healthz`
if [ $? -ne 0 ]; then
if [ "$?" -ne 0 ]; then
echo "Could not reach the UAA server"
exit 1
fi

if [ $status != "ok" ]; then
if [ "$status" != "ok" ]; then
exit 1
fi
echo "Successfully connected to UAA, continuing startup"
Expand Down

0 comments on commit d132fff

Please sign in to comment.