This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Sends a health check ping to the Amboss API. | |
# Docs: https://docs.amboss.space/api/monitoring/health-checks | |
URL="https://api.amboss.space/graphql" | |
NOW=$(date -u +%Y-%m-%dT%H:%M:%S%z) | |
echo "Timestamp: ${NOW}" | |
SIGNATURE=$(lightning-cli signmessage "$NOW" | jq -r .zbase) | |
echo "Signature: ${SIGNATURE}" | |
JSON="{\"query\": \"mutation HealthCheck(\$signature: String!, \$timestamp: String!) { healthCheck(signature: \$signature, timestamp: \$timestamp) }\", \"variables\": {\"signature\": \"$SIGNATURE\", \"timestamp\": \"$NOW\"}}" | |
echo "Sending ping..." |