Created
July 3, 2022 01:42
-
-
Save bradneuman/548cc0d3dde92b6c90461d777bef2583 to your computer and use it in GitHub Desktop.
refund notifier for rocketpool using pushover
This file contains 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
MESSAGE_TITLE="Rocketpool Refund Available!" | |
source ./keys.sh | |
REFUND=`rocketpool minipool status | grep -A 1 "refund"` | |
RESULT=$? | |
if [[ "$1" = "--test" && $RESULT -ne 0 ]]; | |
then | |
RESULT=0 | |
REFUND="just testing at `date`" | |
fi | |
if [ $RESULT -ne 0 ]; | |
then | |
echo "no refund available" | |
exit $RESULT | |
else | |
echo $RESULT | |
echo "sending notification" | |
curl -f -X POST -d "token=$PUSHOVER_TOKEN&user=$PUSHOVER_USER&title=$MESSAGE_TITLE&message=$REFUND&url=&priority=0" https://api.pushover.net/1/messages.json | |
exit $RESULT | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment