Created
April 16, 2020 08:24
-
-
Save Log1x/0c24e25952d039fa7e708d5205cd94f9 to your computer and use it in GitHub Desktop.
Discord Notification Webhook for unRAID
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 | |
# Replace Slack.sh in /boot/config/plugins/dynamix/notifications/agents | |
# Set to your Discord webhook token. | |
WEBHOOK="https://discordapp.com/api/webhooks/ID/TOKEN" | |
curl "$WEBHOOK" \ | |
-X "POST" \ | |
-H 'Content-Type: application/json' \ | |
--data @<(cat <<EOF | |
{ | |
"embeds": [ | |
{ | |
"title": "$EVENT", | |
"description": "$SUBJECT", | |
"footer": { | |
"text": "$(date) on $(hostname)" | |
}, | |
"thumbnail": { | |
"url": "https://i.imgur.com/tlooVc1.png", | |
"height": 16, | |
"width": 16 | |
}, | |
"fields": [ | |
{ | |
"name": "Priority", | |
"value": "${IMPORTANCE^}" | |
}, | |
{ | |
"name": "Description", | |
"value": "$DESCRIPTION\n\n$CONTENT" | |
} | |
] | |
} | |
] | |
} | |
EOF | |
) |
Author
Log1x
commented
Apr 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment