Skip to content

Instantly share code, notes, and snippets.

@xaviablaza
Last active June 21, 2018 01:45
Show Gist options
  • Select an option

  • Save xaviablaza/b47d27f4bfdef9d280601e7d934f3615 to your computer and use it in GitHub Desktop.

Select an option

Save xaviablaza/b47d27f4bfdef9d280601e7d934f3615 to your computer and use it in GitHub Desktop.
Checks the status of stellar-core
#!/bin/bash
# sudo apt install jq
# $1 should be core ip
# $2 should be core port
CORE_STATE=$(curl -s "$1/info" | jq -r '.info.state')
SYNCED_STATE="Synced!"
# if not "Synced!" send "boo"
if [ "$CORE_STATE" != "$SYNCED_STATE" ]; then
echo "boo"
# otherise print 0
else
echo 0
fi
@xaviablaza
Copy link
Copy Markdown
Author

sh core-checker.sh localhost 11626

@ramontayag
Copy link
Copy Markdown

Cool. I think passing the whole domain & port as one will simplify it: ./core-checker.sh http://core.com:1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment