Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Script to automatically post to thundermessage.com using LND / lncli
- # Save to a file like script.sh
- # chmod a+x script.sh
- # ./script.sh "Your awesome message."
- # Donations accepted at: 1H5ZJgZFRSkcxJs4iTaf99Q5sjhH8hCcgp
- SATOSHIS="37"
- MESSAGE="$1"
- DATA='{"body":"'$MESSAGE'","votes":'$SATOSHIS'}'
- CONTENT_TYPE='Content-Type: application/json'
- RESPONSE=`curl --header "$CONTENT_TYPE" --request POST --data "$DATA" https://thundermessage.com/api/submit/post`
- INV_SATS=`echo $RESPONSE | jq '.satoshis'`
- BOLT=`echo $RESPONSE | jq '.bolt11'`
- temp="${BOLT%\"}"
- temp="${temp#\"}"
- echo $temp
- [ $INV_SATS == $SATOSHIS ] && lncli payinvoice $temp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement