File tree Expand file tree Collapse file tree 6 files changed +46
-154
lines changed
Expand file tree Collapse file tree 6 files changed +46
-154
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,19 @@ json=$(
4343 "inline": true
4444 },
4545 {
46- "name": "Address:Port ",
46+ "name": "Server IP ",
4747 "value": "\` ${alertip} :${port} \` ",
4848 "inline": true
49+ },
50+ {
51+ "name": "Hostname",
52+ "value": "${HOSTNAME} ",
53+ "inline": true
54+ },
55+ {
56+ "name": "Server Time",
57+ "value": "$( date) ",
58+ "inline": true
4959 }
5060EOF
5161)
Original file line number Diff line number Diff line change 3535 tags=" ${alertemoji} "
3636fi
3737
38- # Construct the message body
39- message=" Server Name: ${servername}
40- Information: ${alertmessage}
41- Game: ${gamename}
42- Server IP: ${alertip} :${port}
43- Hostname: ${HOSTNAME}
44- Server Time: $( date) "
38+ # Construct the message body (keep formatting consistent with other plain-text alerts)
39+ message=" Server Name
40+ ${servername}
41+
42+ Information
43+ ${alertmessage}
44+
45+ Game
46+ ${gamename}
47+
48+ Server IP
49+ ${alertip} :${port}
50+
51+ Hostname
52+ ${HOSTNAME}
53+
54+ Server Time
55+ $( date) "
4556
4657# Add optional links if available
4758if [ -n " ${querytype} " ]; then
48- message+=" \nIs my Game Server Online?: https ://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} "
59+ message+=" \n\ nIs my Game Server Online?\nhttps ://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} "
4960fi
5061
5162# Use alerturl for the click action if available
5263clickurl=" "
5364if [ -n " ${alerturl} " ]; then
54- message+=" \nMore info: ${alerturl} "
65+ message+=" \n\ nMore info\n ${alerturl} "
5566 clickurl=" ${alerturl} "
5667fi
5768
Original file line number Diff line number Diff line change 2222 alertpriority=" 0"
2323fi
2424
25- message=" <b>Server name </b><br>${servername} <br><br><b>Information</b><br>${alertmessage} <br><br><b>Game</b><br>${gamename} <br><br><b>Server IP</b><br>${alertip} :${port} <br><br><b>Hostname</b><br>${HOSTNAME} <br><br>"
25+ message=" <b>Server Name </b><br>${servername} <br><br><b>Information</b><br>${alertmessage} <br><br><b>Game</b><br>${gamename} <br><br><b>Server IP</b><br>${alertip} :${port} <br><br><b>Hostname</b><br>${HOSTNAME} <br><br>"
2626
2727if [ -n " ${querytype} " ]; then
2828 message+=" <b>Is my Game Server Online?</b><br><a href='https://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} '>Check here</a><br><br>"
@@ -32,7 +32,7 @@ if [ -n "${alerturl}" ]; then
3232 message+=" <b>More info</b><br><a href='${alerturl} '>${alerturl} </a><br><br>"
3333fi
3434
35- message+=" Server Time<br>$( date) "
35+ message+=" <b> Server Time</b> <br>$( date) "
3636
3737pushoversend=$( curl --connect-timeout 3 -sS \
3838 -F token=" ${pushovertoken} " \
Original file line number Diff line number Diff line change @@ -40,94 +40,45 @@ json=$(
4040 {
4141 "short": false,
4242 "title": "Server IP",
43- "value": "${alertip} :${port} "
43+ "value": "\` ${alertip} :${port} \` "
4444 },
4545 {
4646 "short": false,
4747 "title": "Hostname",
4848 "value": "${HOSTNAME} "
49- },
50- {
51- "short": false,
52- "title": "More info",
53- "value": "${alerturl} "
54- },
55- {
56- "short": false,
57- "title": "Server Time",
58- "value": "$( date) "
5949 }
60- ]
61- }
62- ]
63- }
6450EOF
6551)
6652
6753if [ -n " ${querytype} " ]; then
6854 json+=$(
6955 cat << EOF
56+ ,
7057 {
7158 "short": false,
7259 "title": "Is my Game Server Online?",
7360 "value": "<https://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} |Check here>"
74- },
61+ }
7562EOF
7663 )
7764fi
7865
7966if [ -n " ${alerturl} " ]; then
8067 json+=$(
8168 cat << EOF
69+ ,
8270 {
8371 "short": false,
8472 "title": "More info",
8573 "value": "${alerturl} "
86- },
74+ }
8775EOF
8876 )
8977fi
9078
9179json+=$(
9280 cat << EOF
93- {
94- "alias": "LinuxGSM",
95- "text": "*${alerttitle} *",
96- "attachments": [
97- {
98- "title": "",
99- "color": "${alertcolourhex} ",
100- "author_name": "LinuxGSM Alert",
101- "author_link": "https://linuxgsm.com",
102- "author_icon": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg",
103- "thumb_url": "${alerticon} ",
104- "text": "",
105- "fields": [
106- {
107- "short": false,
108- "title": "Server Name",
109- "value": "${servername} "
110- },
111- {
112- "short": false,
113- "title": "Information",
114- "value": "${alertmessage} "
115- },
116- {
117- "short": false,
118- "title": "Game",
119- "value": "${gamename} "
120- },
121- {
122- "short": false,
123- "title": "Server IP",
124- "value": "${alertip} :${port} "
125- },
126- {
127- "short": false,
128- "title": "Hostname",
129- "value": "${HOSTNAME} "
130- },
81+ ,
13182 {
13283 "short": false,
13384 "title": "Server Time",
Original file line number Diff line number Diff line change @@ -62,124 +62,44 @@ json=$(
6262 "accessory": {
6363 "type": "image",
6464 "image_url": "${alerticon} ",
65- "alt_text": "cute cat "
65+ "alt_text": "LinuxGSM game icon "
6666 }
67- },
68- {
69- "type": "context",
70- "elements": [
71- {
72- "type": "image",
73- "image_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg",
74- "alt_text": "LinuxGSM icon"
75- },
76- {
77- "type": "plain_text",
78- "text": "Sent by LinuxGSM ${version} ",
79- "emoji": true
80- }
81- ]
82- }
83- ]
84- }
85- ]
86- }
8767EOF
8868)
8969
9070if [ -n " ${querytype} " ]; then
9171 json+=$(
9272 cat << EOF
73+ ,
9374 {
9475 "type": "section",
9576 "text": {
9677 "type": "mrkdwn",
9778 "text": "*Is my Game Server Online?*\n<https://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} |Check here>"
9879 }
99- },
80+ }
10081EOF
10182 )
10283fi
10384
10485if [ -n " ${alerturl} " ]; then
10586 json+=$(
10687 cat << EOF
88+ ,
10789 {
10890 "type": "section",
10991 "text": {
11092 "type": "mrkdwn",
11193 "text": "*More info*\n<${alerturl} |${alerturl} >"
11294 }
113- },
95+ }
11496EOF
11597 )
11698fi
11799
118100json+=$(
119101 cat << EOF
120- {
121- "attachments": [
122- {
123- "color": "${alertcolourhex} ",
124- "blocks": [
125- {
126- "type": "header",
127- "text": {
128- "type": "mrkdwn",
129- "text": "${alerttitle} ",
130- "emoji": true
131- }
132- },
133- {
134- "type": "divider"
135- },
136- {
137- "type": "section",
138- "text": {
139- "type": "mrkdwn",
140- "text": "*Server Name*\n${servername} "
141- }
142- },
143- {
144- "type": "section",
145- "text": {
146- "type": "mrkdwn",
147- "text": "*Information*\n${alertmessage} "
148- }
149- },
150- {
151- "type": "section",
152- "fields": [
153- {
154- "type": "mrkdwn",
155- "text": "*Game*\n${gamename} "
156- },
157- {
158- "type": "mrkdwn",
159- "text": "*Server IP*\n\` ${alertip} :${port} \` "
160- },
161- {
162- "type": "mrkdwn",
163- "text": "*Hostname*\n${HOSTNAME} "
164- },
165- {
166- "type": "mrkdwn",
167- "text": "*Server Time*\n$( date) "
168- }
169- ],
170- "accessory": {
171- "type": "image",
172- "image_url": "${alerticon} ",
173- "alt_text": "cute cat"
174- }
175- },
176- {
177- "type": "section",
178- "text": {
179- "type": "mrkdwn",
180- "text": "*Server Time*\n${alertmessage} "
181- }
182- },
102+ ,
183103 {
184104 "type": "context",
185105 "elements": [
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ json=$(
1414 "message_thread_id": "${telegramthreadid} ",
1515 "parse_mode": "HTML",
1616 "disable_notification": "${telegramdisablenotification} ",
17- "text": "<b>${alerttitle} </b>\n\n<b>Server name </b>\n${servername} \n\n<b>Information</b>\n${alertmessage} \n\n<b>Game</b>\n${gamename} \n\n<b>Server IP</b>\n${alertip} :${port} \n\n<b>Hostname</b>\n${HOSTNAME} \n\n
17+ "text": "<b>${alerttitle} </b>\n\n<b>Server Name </b>\n${servername} \n\n<b>Information</b>\n${alertmessage} \n\n<b>Game</b>\n${gamename} \n\n<b>Server IP</b>\n${alertip} :${port} \n\n<b>Hostname</b>\n${HOSTNAME} \n\n
1818EOF
1919)
2020
You can’t perform that action at this time.
0 commit comments