Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
#143: Make sure shield is running before starting setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ampersand8 committed Sep 19, 2018
1 parent c7cb1c8 commit dba3919
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker/setup_shield.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
set -e

HOST='localhost:8443'
INTERVAL_IN_SECONDS='5'
MAX_RETRIES='20'

echo "Waiting for shield to startup"
retries=0
for ((retries=0; retries<=MAX_RETRIES; retries++)); do
if curl -k https://${HOST}/v2/info ; then
break
fi
echo "Trie ${i} failed, retrying in ${INTERVAL_IN_SECONDS}s"
done

# Login
X_SHIELD_SESSION=$(curl -i -k -H 'Accept: application/json' -H 'Content-Type: application/json' -X POST https://${HOST}/v2/auth/login -d '{"username":"admin","password":"shield"}' | grep X-Shield-Session | awk '{print $2}')
Expand Down

0 comments on commit dba3919

Please sign in to comment.