Last active
June 26, 2024 15:39
-
-
Save Xmonpl/3c8585d34c83459ac6a3be1f8cb5d129 to your computer and use it in GitHub Desktop.
Discord notification for OpenMediaVault
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
#!/bin/bash | |
#CREATED BY XMON FOR OpenMediaVault | |
DISCORD_WEBHOOK='PUT YOUR WEBHOOK LINK HERE' | |
generate_post_data() { | |
cat <<EOF | |
{ | |
"content": "", | |
"embeds": [{ | |
"title": "${OMV_NOTIFICATION_SUBJECT}", | |
"description": "$(cat ${OMV_NOTIFICATION_MESSAGE_FILE})", | |
"color": "45973", | |
"footer": { | |
"text": "${OMV_NOTIFICATION_DATE}", | |
"icon_url": "" | |
} | |
}] | |
} | |
EOF | |
} | |
curl -H "Content-Type: application/json" -X POST -d "$(generate_post_data)" $DISCORD_WEBHOOK |
Yea, I glad that you managed to fix your problem.
W dniu sob., 16.09.2023 o 00:35 Furtys ***@***.***>
napisał(a):
… ***@***.**** commented on this gist.
------------------------------
Hi !
Thanks for your script. Does it work with the test email on your side ?
Because I tried it but no discord publication on my side 😢
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/Xmonpl/3c8585d34c83459ac6a3be1f8cb5d129#gistcomment-4694044>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHOM7W37QFXEYK6RTFXD3GTX2TJ3HBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTEMZRG43TQNZZU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you authored the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Is there any way to edit what notifications it sends out? Also, is there a way to test it to make sure it actually works?
You can edify body json to edify the appearance of the sent embed. And you
can test it directly in the omv panel.
W dniu czw., 23.11.2023 o 23:07 Ashton ***@***.***>
napisał(a):
… ***@***.**** commented on this gist.
------------------------------
Is there any way to edit what notifications it sends out? Also, is there a
way to test it to make sure it actually works?
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/Xmonpl/3c8585d34c83459ac6a3be1f8cb5d129#gistcomment-4770957>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHOM7W5XFYMP23VEYHZWBTDYF7CJ5BFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTEMZRG43TQNZZU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you authored the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Hello. Cant seem to get this to work. Should it fire when the email triggers?
yes. I keep email on, just disable authentication so that emails don't actually go out. The Test button should work to test the discord notification at this point.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi !
Thanks for your script. Does it work with the test email on your side ?
Because I tried it but no discord publication on my side 😢
EDIT : My bad, OMV don't have curl installed by default...
Just run
apt-get install curl
and this script works as expected !Perfect for server booted notification 💪