Skip to content

Commit

Permalink
Merge pull request #2 from ianco/update-revoc-demo
Browse files Browse the repository at this point in the history
Fix location of jq in script
  • Loading branch information
nrempel committed Aug 4, 2020
2 parents c286654 + eafabb3 commit 96a9c9b
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions demo/ngrok-wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
if ! [ -z "$TAILS_NGROK_NAME" ]; then
echo "ngrok tails service name [$TAILS_NGROK_NAME]"
NGROK_ENDPOINT=null
while [ -z "$NGROK_ENDPOINT" ] || [ "$NGROK_ENDPOINT" = "null" ]
do
echo "Fetching endpoint from ngrok service"
NGROK_ENDPOINT=$(curl --silent $TAILS_NGROK_NAME:4040/api/tunnels | ./jq -r '.tunnels[0].public_url')

if [ -z "$NGROK_ENDPOINT" ] || [ "$NGROK_ENDPOINT" = "null" ]; then
echo "ngrok not ready, sleeping 5 seconds...."
sleep 5
fi
done
JQ=${JQ:-`which jq`}
if [ -x "$JQ" ]; then
while [ -z "$NGROK_ENDPOINT" ] || [ "$NGROK_ENDPOINT" = "null" ]
do
echo "Fetching endpoint from ngrok service"
NGROK_ENDPOINT=$(curl --silent $TAILS_NGROK_NAME:4040/api/tunnels | $JQ -r '.tunnels[0].public_url')

if [ -z "$NGROK_ENDPOINT" ] || [ "$NGROK_ENDPOINT" = "null" ]; then
echo "ngrok not ready, sleeping 5 seconds...."
sleep 5
fi
done
else
echo " not found"
fi
export PUBLIC_TAILS_URL=$NGROK_ENDPOINT
echo "Fetched ngrok tails server endpoint [$PUBLIC_TAILS_URL]"
fi
Expand Down

0 comments on commit 96a9c9b

Please sign in to comment.