Influencer Posted June 26, 2019 Share Posted June 26, 2019 I recently had a need/want to have the system send an email to my wife's email address when her SD cards were finished backing up to the server. I use Unassigned Devices to fire off a script when she inserts the card into the server that backs up the card to a server share. But she wouldn't know when it was done unless I had her email address in the notification settings. She doesn't care to receive the usual system notifications such as parity checks, temp warnings, etc. And I don't care to receive the notifications when her card is done backing up. But unless I interacted with ssmtp directly, I didn't have much choice. So I modified the Notify script to allow a little more flexibility, posting here in case it helps anyone else. Really simple change that doesn't affect current functionality, maybe the update can be included in the next release of unraid? List of changes: Line 22: Updated example usage Line 30: Explanation of option Line 50: Added recipients to function parameters Lines 54-57: If -r flag was used and an email address was provided, use that. If not, use the default email list from the notification settings Line 167: Add 'r' option Lines 186-188: Add case for 'r' option Line 203: pass in list of recipients to generate_email function So if my notification settings are set to send the emails to [email protected], in the backup script when I fire off a notification I pass in '-r "[email protected]"' which now overrides the default email in the notification settings and only sends it to her. Currently of course, you would need to add a line in your go file or if you are using the user scripts plugin you could add it there as well and set it to run at array start. The notify script resides at '/usr/local/emhttp/webGui/scripts/notify' If you had the new notify script saved to /boot/scripts/ you would add this to the go file (or user script) cp /boot/scripts/notify /usr/local/emhttp/webGui/scripts/notify notify Quote Link to comment
Squid Posted June 26, 2019 Share Posted June 26, 2019 1 minute ago, Influencer said: maybe the update can be included in the next release of unraid? https://github.com/limetech/webgui 1 Quote Link to comment
Influencer Posted June 26, 2019 Author Share Posted June 26, 2019 1 minute ago, Squid said: https://github.com/limetech/webgui I've been away from the community for too long, didn't know that existed! Quote Link to comment
GHunter Posted June 27, 2019 Share Posted June 27, 2019 Thanks for posting this. I've used notify in some of my scripts as well and this will certainly add more flexibility. I appreciate it! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.