Hello,
I've checked the forums and I can't seem to find an answer to my problem. I'm trying to get pushover notifications on my phone for my server but all the environment variables are blank when executing the script.
Here is the script for pushover which is in /usr/share/openmediavault/notification/sink.d/push_notification:
#!/bin/bash
curl -s \
-F "token=<app_token>" \
-F "user=<user_token>" \
-F "title=${OMV_NOTIFICATION_SUBJECT}" \
-F "message=${cat ${OMV_NOTIFICATION_MESSAGE_FILE})" \
-F "url=https://<url>" \
-F "url_title=Go to dashboard for more info" \
-F "priority=1" \
https://api.pushover.net/1/messages.json
When sending a test email, nothing will show up but I'll receive the email. When I manually execute the script, it will just hang and will not send a request. I thought it was because cat is reading for a file that doesn't exist but I've created another script that checks the environment variables passed in by /usr/share/openmediavault/notification/postfix-runner.sh:
#!/bin/bash
cat ${OMV_NOTIFICATION_SUBJECT} > /tmp/testmessage.txt
cat ${OMV_NOTIFICATION_MESSAGE_FILE} >> /tmp/testmessage.txt
All I get is This is an automatically generated mail message from the system notification service running on ServerHDD. There was no subject line. I'm not for sure if it's because of the test email doesn't have a subject line. As you can see, it executes the script and passes in the (at least one) variables but it doesn't seem to work with my other script.
If anyone could help, that would be great!