Ok I didn't realize I was confused by two separate script things. I was using the "Notification Script" API instead of the Post Processing API. The $1-$7 are a part of the Post Processing system for Sabnzbd, and the Notification Script thing doesn't seem to have as much detail. I see that the passed parameters are strings like "completed", "failed" etc. However it's not explained well enough on how to include the other parameters like filename, path etc.
SO ANYWAY, I GOT IT WORKING NOW. I have now correctly set each category in my client to use the script below, and I now get the notification.
ORIGINAL POST BELOW FOR REFERENCE
I have been banging my head against the wall for the past few hours trying to get this to work. For some reason, Bash keeps receiving the $7 parameter as a non-zero character. All I'm trying to do is send myself a notification featuring the filename. I have every other piece working.
Here is my bash code:
Code: Select all
#!/bin/bash
if [ "$7" = "0" ]; then
echo "0 Status"
curl -X POST -H "Content-Type:application/json" -H "Access-Token:MY_ACCESS_TOKEN" -d '{"type":"note","title":"'$3'['$5'] Success","body":"'$3'['$5'] Complete","Content-Type": "application/json"}' https://api.pushbullet.com/v2/pushes
else
echo "Non zero status"
curl -X POST -H "Content-Type:application/json" -H "Access-Token:MY_ACCESS_TOKEN" -d '{"type":"note","title":"'$3'['$5'] Failed","body":"'$3'['$5'] Failed","Content-Type": "application/json"}' https://api.pushbullet.com/v2/pushes
fi