mirror of
https://github.com/unraid/webgui.git
synced 2026-02-22 10:21:39 -06:00
Merge pull request #1469 from ich777/master
Add ntfy.sh to notification agents
This commit is contained in:
BIN
emhttp/plugins/dynamix/icons/ntfy.sh.png
Normal file
BIN
emhttp/plugins/dynamix/icons/ntfy.sh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 534 B |
@@ -287,6 +287,47 @@ done
|
||||
]]>
|
||||
</Script>
|
||||
</Agent>
|
||||
<Agent>
|
||||
<Name>ntfy.sh</Name>
|
||||
<Variables>
|
||||
<Variable Help="The full server base URL including protocol and port. eg: https://ntfy.sh" Desc="Full Server Base URL" Default="FULL NTFY.SH URL">SERVER_URL</Variable>
|
||||
<Variable Help="The ntfy.sh Token to use." Desc="ntfy.sh Token" Default="YOUR NTFY.SH TOKEN">NTFY_TOKEN</Variable>
|
||||
<Variable Help="The ntfy.sh Topic to use." Desc="ntfy.sh Topic" Default="Unraid">TOPIC</Variable>
|
||||
<Variable Help="Specify the fields which are included in the title of the notification." Desc="Notification Title" Default="$SUBJECT">TITLE</Variable>
|
||||
<Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable>
|
||||
</Variables>
|
||||
<Script>
|
||||
<![CDATA[
|
||||
#!/bin/bash
|
||||
############
|
||||
{0}
|
||||
############
|
||||
MESSAGE=$(echo -e "$MESSAGE")
|
||||
case "$IMPORTANCE" in
|
||||
'normal' )
|
||||
PRIORITY="default"
|
||||
;;
|
||||
'warning' )
|
||||
PRIORITY="high"
|
||||
;;
|
||||
'alert' )
|
||||
PRIORITY="urgent"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Remove any trailing slash
|
||||
SERVER_URL=${SERVER_URL%/}
|
||||
|
||||
curl \
|
||||
-H "Priority: $PRIORITY" \
|
||||
-H "Icon: https://raw.githubusercontent.com/unraid/webgui/master/emhttp/plugins/dynamix.vm.manager/templates/images/unraid.png" \
|
||||
-H "Authorization: Bearer $NTFY_TOKEN" \
|
||||
-H "Title: $TITLE" \
|
||||
-d "$MESSAGE" \
|
||||
$SERVER_URL/$TOPIC
|
||||
]]>
|
||||
</Script>
|
||||
</Agent>
|
||||
<Agent>
|
||||
<Name>Prowl</Name>
|
||||
<Variables>
|
||||
|
||||
Reference in New Issue
Block a user