sort agents alphabetically, add telegram notifications

This commit is contained in:
realies
2019-01-02 07:43:29 +00:00
parent 2e6eb0425c
commit 30858b51be
2 changed files with 105 additions and 65 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -3,7 +3,8 @@
<Agent>
<Name>Boxcar</Name>
<Variables>
<Variable Help="Get your access token as explained [a href='http://help.boxcar.io/knowledgebase/articles/314474-how-to-get-my-boxcar-access-token' target='_blank'][u]here[/u].[/a]" Desc="Access Token" Default="">ACCESS_TOKEN</Variable>
<Variable Help="Get your access token as explained [a href='http://help.boxcar.io/knowledgebase/articles/314474-how-to-get-my-boxcar-access-token' target='_blank'][u]here[/u].[/a]" Desc="Access Token"
Default="">ACCESS_TOKEN</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>
@@ -26,6 +27,70 @@
]]>
</Script>
</Agent>
<Agent>
<Name>Join</Name>
<Variables>
<Variable Help="The API key can be found [a href='https://joinjoaomgcd.appspot.com' target='_blank'] [u]here[/u].[/a]" Desc="API key" Default="">API_KEY</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}
##########
TITLE=$(echo -e "$TITLE")
MESSAGE=$(echo -e "$MESSAGE")
curl -s -k -G \
-d "apikey=$API_KEY" \
--data-urlencode "title=$TITLE" \
--data-urlencode "text=$MESSAGE" \
-d "deviceId=group.all" \
https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush 2>&1
]]>
</Script>
</Agent>
<Agent>
<Name>Notify My Android</Name>
<Variables>
<Variable Help="The API key can be found [a href='https://www.notifymyandroid.com/account.jsp' target='_blank'] [u]here[/u].[/a]" Desc="API key" Default="">API_KEY</Variable>
<Variable Help="Application name, e.g., Unraid Server." Desc="Application Name" Default="Unraid Server">APP_NAME</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}
##########
TITLE=$(echo -e "$TITLE")
MESSAGE=$(echo -e "$MESSAGE")
case "$IMPORTANCE" in
'normal' )
PRIORITY="0"
;;
'warning' )
PRIORITY="1"
;;
'alert' )
PRIORITY="2"
;;
esac
curl -s -k \
-d "apikey=$API_KEY" \
-d "application=$APP_NAME" \
-d "event=$TITLE" \
-d "description=$MESSAGE" \
-d "priority=$PRIORITY" \
https://www.notifymyandroid.com/publicapi/notify 2>&1
]]>
</Script>
</Agent>
<Agent>
<Name>Prowl</Name>
<Variables>
@@ -125,70 +190,6 @@
]]>
</Script>
</Agent>
<Agent>
<Name>Notify My Android</Name>
<Variables>
<Variable Help="The API key can be found [a href='https://www.notifymyandroid.com/account.jsp' target='_blank'] [u]here[/u].[/a]" Desc="API key" Default="">API_KEY</Variable>
<Variable Help="Application name, e.g., Unraid Server." Desc="Application Name" Default="Unraid Server">APP_NAME</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}
##########
TITLE=$(echo -e "$TITLE")
MESSAGE=$(echo -e "$MESSAGE")
case "$IMPORTANCE" in
'normal' )
PRIORITY="0"
;;
'warning' )
PRIORITY="1"
;;
'alert' )
PRIORITY="2"
;;
esac
curl -s -k \
-d "apikey=$API_KEY" \
-d "application=$APP_NAME" \
-d "event=$TITLE" \
-d "description=$MESSAGE" \
-d "priority=$PRIORITY" \
https://www.notifymyandroid.com/publicapi/notify 2>&1
]]>
</Script>
</Agent>
<Agent>
<Name>Join</Name>
<Variables>
<Variable Help="The API key can be found [a href='https://joinjoaomgcd.appspot.com' target='_blank'] [u]here[/u].[/a]" Desc="API key" Default="">API_KEY</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}
##########
TITLE=$(echo -e "$TITLE")
MESSAGE=$(echo -e "$MESSAGE")
curl -s -k -G \
-d "apikey=$API_KEY" \
--data-urlencode "title=$TITLE" \
--data-urlencode "text=$MESSAGE" \
-d "deviceId=group.all" \
https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush 2>&1
]]>
</Script>
</Agent>
<Agent>
<Name>Slack</Name>
<Variables>
@@ -210,4 +211,43 @@
]]>
</Script>
</Agent>
<Agent>
<Name>Telegram</Name>
<Variables>
<Variable Help="[a href='https://telegram.me/botfather' target='_blank'][u]BotFather[/u][/a] is the one bot to rule them all.[br][br]
1. Make a bot using BotFather[br]
2. Paste bot token in this field[br]
3. Select bot via Telegram and press /start[br]
4. Test bot (first test will be slow)[/a]" Desc="Bot Access Token" Default="">BOT_TOKEN</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}
############
if [ ! -f /usr/local/bin/jq ]; then
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o /usr/local/bin/jq;
chmod +x /usr/local/bin/jq;
mkdir -p /boot/config/telegram/;
cp /usr/local/bin/jq /boot/config/telegram;
grep -q "/jq" /boot/config/go;
[ $? -eq 1 ] && echo "cp /boot/config/telegram/jq /usr/local/bin" >> /boot/config/go;
fi
fi
if [ ! -f /boot/config/telegram/chatid ]; then
mkdir -p /boot/config/telegram/;
curl https://api.telegram.org/bot732434840:AAGZrCtRmqX6YpKghfzUck8q4z_hDluwIDQ/getUpdates | jq ".result | last .message .chat .id" > /boot/config/telegram/chatid;
fi
CHATID=$(cat /boot/config/telegram/chatid)
MESSAGE=$(echo -e "$(hostname): $MESSAGE")
curl -G -v "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" --data-urlencode "chat_id=$CHATID" --data-urlencode "text=$MESSAGE" 2>&1
]]>
</Script>
</Agent>
</Agents>