Skip to content

Commit

Permalink
Fix healthcheck to exit on yagna socket issues too
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptobench committed Feb 8, 2024
1 parent 97470aa commit ff8fa4b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion check_yagna.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
export KEY=$(yagna app-key list --json | jq -r '.values[0][1]')
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status.
set -x # Print commands and their arguments as they are executed.

# Get the Yagna app key
KEY=$(yagna app-key list --json | jq -r '.[0].key')

if [ -z "$KEY" ]; then
echo "Key is empty, exiting."
exit 1
fi

# Use the key in the curl command
curl -H "Authorization: Bearer ${KEY}" 127.0.0.1:7465/me

0 comments on commit ff8fa4b

Please sign in to comment.