diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh
index d5b1c464e..c0434df89 100644
--- a/lgsm/modules/alert_discord.sh
+++ b/lgsm/modules/alert_discord.sh
@@ -10,82 +10,82 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(
cat << EOF
{
- "username": "LinuxGSM",
- "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
- "file": "content",
- "embeds": [
- {
- "author": {
- "name": "LinuxGSM Alert",
- "url": "",
- "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg"
- },
- "title": "${alerttitle}",
- "url": "",
- "description": "",
- "color": "${alertcolourdec}",
- "type": "content",
- "thumbnail": {
- "url": "${alerticon}"
- },
- "fields": [
- {
- "name": "Server Name",
- "value": "${servername}"
- },
- {
- "name": "Information",
- "value": "${alertmessage}"
- },
- {
- "name": "Game",
- "value": "${gamename}",
- "inline": true
- },
- {
- "name": "Server IP",
- "value": "\`${alertip}:${port}\`",
- "inline": true
- },
- {
- "name": "Hostname",
- "value": "${HOSTNAME}",
- "inline": true
- },
+ "username": "LinuxGSM",
+ "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
+ "file": "content",
+ "embeds": [
+ {
+ "author": {
+ "name": "LinuxGSM Alert",
+ "url": "",
+ "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg"
+ },
+ "title": "${alerttitle}",
+ "url": "",
+ "description": "",
+ "color": "${alertcolourdec}",
+ "type": "content",
+ "thumbnail": {
+ "url": "${alerticon}"
+ },
+ "fields": [
+ {
+ "name": "Server Name",
+ "value": "${servername}"
+ },
+ {
+ "name": "Information",
+ "value": "${alertmessage}"
+ },
+ {
+ "name": "Game",
+ "value": "${gamename}",
+ "inline": true
+ },
+ {
+ "name": "Server IP",
+ "value": "\`${alertip}:${port}\`",
+ "inline": true
+ },
+ {
+ "name": "Hostname",
+ "value": "${HOSTNAME}",
+ "inline": true
+ },
EOF
)
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
- {
- "name": "Is my Game Server Online?",
- "value": "https://ismygameserver.online/${querytype}/${alertip}:${queryport}",
- "inline": true
- },
+ {
+ "name": "Is my Game Server Online?",
+ "value": "https://ismygameserver.online/${querytype}/${alertip}:${queryport}",
+ "inline": true
+ },
EOF
)
fi
json+=$(
cat << EOF
- {
- "name": "More info",
- "value": "${alerturl}",
- "inline": true
- },
- {
- "name": "Server Time",
- "value": "$(date)",
- "inline": true
- }
- ],
- "footer": {
- "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
- "text": "Sent by LinuxGSM ${version}"
- }
- }
- ]
+ {
+ "name": "More info",
+ "value": "${alerturl}",
+ "inline": true
+ },
+ {
+ "name": "Server Time",
+ "value": "$(date)",
+ "inline": true
+ }
+ ],
+ "footer": {
+ "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
+ "text": "Sent by LinuxGSM ${version}"
+ }
+ }
+ ]
}
EOF
)
diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh
index 8f1d31e91..63f083b3b 100644
--- a/lgsm/modules/alert_gotify.sh
+++ b/lgsm/modules/alert_gotify.sh
@@ -7,32 +7,38 @@
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-jsoninfo=$(
+json=$(
cat << EOF
{
- "title": "${alerttitle}",
- "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)",
- "priority": 5
-}
+ "title": "${alerttitle}",
+ "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n
EOF
)
-jsonnoinfo=$(
+if [ -n "${querytype}" ]; then
+ json+=$(
+ cat << EOF
+Is my Game Server Online?\nhttps://ismygameserver.online/${querytype}/${alertip}:${queryport}\n\n
+EOF
+ )
+fi
+
+if [ -n "${alerturl}" ]; then
+ json+=$(
+ cat << EOF
+More info\n${alerturl}\n\n
+EOF
+ )
+fi
+
+json+=$(
cat << EOF
-{
- "title": "${alerttitle}",
- "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)",
- "priority": 5
+Server Time\n$(date)",
+ "priority": 5
}
EOF
)
-if [ -z "${alerturl}" ]; then
- json="${jsonnoinfo}"
-else
- json="${jsoninfo}"
-fi
-
fn_print_dots "Sending Gotify alert"
gotifysend=$(curl --connect-timeout 3 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)")
diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh
index cbd740ec5..5d4660b1c 100644
--- a/lgsm/modules/alert_ifttt.sh
+++ b/lgsm/modules/alert_ifttt.sh
@@ -7,32 +7,38 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-jsoninfo=$(
+json=$(
cat << EOF
{
- "value1": "${selfname}",
- "value2": "${alerttitle}",
- "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)"
-}
+ "value1": "${selfname}",
+ "value2": "${alerttitle}",
+ "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n
EOF
)
-jsonnoinfo=$(
+if [ -n "${querytype}" ]; then
+ json+=$(
+ cat << EOF
+Is my Game Server Online?\nhttps://ismygameserver.online/${querytype}/${alertip}:${queryport}\n\n
+EOF
+ )
+fi
+
+if [ -n "${alerturl}" ]; then
+ json+=$(
+ cat << EOF
+More info\n${alerturl}\n\n
+EOF
+ )
+fi
+
+json+=$(
cat << EOF
-{
- "value1": "${selfname}",
- "value2": "${alerttitle}",
- "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)"
+Server Time\n$(date)"
}
EOF
)
-if [ -z "${alerturl}" ]; then
- json="${jsonnoinfo}"
-else
- json="${jsoninfo}"
-fi
-
fn_print_dots "Sending IFTTT alert"
iftttsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request")
diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh
index 5ed3853f6..4a47df442 100644
--- a/lgsm/modules/alert_pushbullet.sh
+++ b/lgsm/modules/alert_pushbullet.sh
@@ -7,34 +7,39 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-jsoninfo=$(
+json=$(
cat << EOF
{
- "channel_tag": "${channeltag}",
- "type": "note",
- "title": "${alerttitle}",
- "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)"
-}
+ "channel_tag": "${channeltag}",
+ "type": "note",
+ "title": "${alerttitle}",
+ "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n
EOF
)
-jsonnoinfo=$(
+if [ -n "${querytype}" ]; then
+ json+=$(
+ cat << EOF
+Is my Game Server Online?\nhttps://ismygameserver.online/${querytype}/${alertip}:${queryport}\n\n
+EOF
+ )
+fi
+
+if [ -n "${alerturl}" ]; then
+ json+=$(
+ cat << EOF
+More info\n${alerturl}\n\n
+EOF
+ )
+fi
+
+json+=$(
cat << EOF
-{
- "channel_tag": "${channeltag}",
- "type": "note",
- "title": "${alerttitle}",
- "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)"
+Server Time\n$(date)"
}
EOF
)
-if [ -z "${alerturl}" ]; then
- json="${jsonnoinfo}"
-else
- json="${jsoninfo}"
-fi
-
fn_print_dots "Sending Pushbullet alert"
pushbulletsend=$(curl --connect-timeout 3 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code")
diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh
index 22180d503..246cffff1 100644
--- a/lgsm/modules/alert_pushover.sh
+++ b/lgsm/modules/alert_pushover.sh
@@ -22,12 +22,28 @@ else
alertpriority="0"
fi
-if [ -z "${alerturl}" ]; then
- pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}
Information
${alertmessage}
Game
${gamename}
Server IP
${alertip}:${port}
Hostname
${HOSTNAME}
Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors)
-else
- pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}
Information
${alertmessage}
Game
${gamename}
Server IP
${alertip}:${port}
Hostname
${HOSTNAME}
More info
${alerturl}
Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors)
+message=" Server name
${servername}
Information
${alertmessage}
Game
${gamename}
Server IP
${alertip}:${port}
Hostname
${HOSTNAME}
"
+
+if [ -n "${querytype}" ]; then
+ message+="Is my Game Server Online?
Check here
"
+fi
+
+if [ -n "${alerturl}" ]; then
+ message+="More info
${alerturl}
"
fi
+message+="Server Time
$(date)"
+
+pushoversend=$(curl --connect-timeout 3 -sS \
+ -F token="${pushovertoken}" \
+ -F user="${pushoveruserkey}" \
+ -F html="1" \
+ -F sound="${alertsound}" \
+ -F priority="${alertpriority}" \
+ -F title="${alerttitle}" \
+ -F message="${message}" \
+ "https://api.pushover.net/1/messages.json" | grep errors)
+
if [ -n "${pushoversend}" ]; then
fn_print_fail_nl "Sending Pushover alert: ${pushoversend}"
fn_script_log_fail "Sending Pushover alert: ${pushoversend}"
diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh
index 910722804..e9cf83b22 100644
--- a/lgsm/modules/alert_rocketchat.sh
+++ b/lgsm/modules/alert_rocketchat.sh
@@ -7,121 +7,87 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-jsoninfo=$(
+json=$(
cat << EOF
{
- "alias": "LinuxGSM",
- "text": "*${alerttitle}*",
- "attachments": [
- {
- "title": "",
- "color": "${alertcolourhex}",
- "author_name": "LinuxGSM Alert",
- "author_link": "https://linuxgsm.com",
- "author_icon": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
- "thumb_url": "${alerticon}",
- "text": "",
- "fields": [
- {
- "short": false,
- "title": "Server Name",
- "value": "${servername}"
- },
- {
- "short": false,
- "title": "Information",
- "value": "${alertmessage}"
- },
- {
- "short": false,
- "title": "Game",
- "value": "${gamename}"
- },
- {
- "short": false,
- "title": "Server IP",
- "value": "${alertip}:${port}"
- },
- {
- "short": false,
- "title": "Hostname",
- "value": "${HOSTNAME}"
- },
- {
- "short": false,
- "title": "More info",
- "value": "${alerturl}"
- },
- {
- "short": false,
- "title": "Server Time",
- "value": "$(date)"
- }
- ]
- }
- ]
-}
+ "alias": "LinuxGSM",
+ "text": "*${alerttitle}*",
+ "attachments": [
+ {
+ "title": "",
+ "color": "${alertcolourhex}",
+ "author_name": "LinuxGSM Alert",
+ "author_link": "https://linuxgsm.com",
+ "author_icon": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
+ "thumb_url": "${alerticon}",
+ "text": "",
+ "fields": [
+ {
+ "short": false,
+ "title": "Server Name",
+ "value": "${servername}"
+ },
+ {
+ "short": false,
+ "title": "Information",
+ "value": "${alertmessage}"
+ },
+ {
+ "short": false,
+ "title": "Game",
+ "value": "${gamename}"
+ },
+ {
+ "short": false,
+ "title": "Server IP",
+ "value": "${alertip}:${port}"
+ },
+ {
+ "short": false,
+ "title": "Hostname",
+ "value": "${HOSTNAME}"
+ },
EOF
)
-jsonnoinfo=$(
+if [ -n "${querytype}" ]; then
+ json+=$(
+ cat << EOF
+ {
+ "short": false,
+ "title": "Is my Game Server Online?",
+ "value": ""
+ },
+EOF
+ )
+fi
+
+if [ -n "${alerturl}" ]; then
+ json+=$(
+ cat << EOF
+ {
+ "short": false,
+ "title": "More info",
+ "value": "${alerturl}"
+ },
+EOF
+ )
+fi
+
+json+=$(
cat << EOF
-{
- "alias": "LinuxGSM",
- "text": "*${alerttitle}*",
- "attachments": [
- {
- "title": "",
- "color": "${alertcolourhex}",
- "author_name": "LinuxGSM Alert",
- "author_link": "https://linuxgsm.com",
- "author_icon": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
- "thumb_url": "${alerticon}",
- "text": "",
- "fields": [
- {
- "short": false,
- "title": "Server Name",
- "value": "${servername}"
- },
- {
- "short": false,
- "title": "Information",
- "value": "${alertmessage}"
- },
- {
- "short": false,
- "title": "Game",
- "value": "${gamename}"
- },
- {
- "short": false,
- "title": "Server IP",
- "value": "${alertip}:${port}"
- },
- {
- "short": false,
- "title": "Hostname",
- "value": "${HOSTNAME}"
- },
- {
- "short": false,
- "title": "Server Time",
- "value": "$(date)"
- }
- ]
- }
- ]
+ {
+ "short": false,
+ "title": "Server Time",
+ "value": "$(date)"
+ }
+ ]
+ }
+ ]
}
EOF
)
-if [ -z "${alerturl}" ]; then
- json="${jsonnoinfo}"
-else
- json="${jsoninfo}"
-fi
-
fn_print_dots "Sending Rocketchat alert"
rocketchatsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}")
diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh
index b74f98dec..2565ea832 100644
--- a/lgsm/modules/alert_slack.sh
+++ b/lgsm/modules/alert_slack.sh
@@ -7,179 +7,119 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-jsonnoinfo=$(
+json=$(
cat << EOF
{
- "attachments": [
- {
- "color": "${alertcolourhex}",
- "blocks": [
- {
- "type": "header",
- "text": {
- "type": "mrkdwn",
- "text": "${alerttitle}",
- "emoji": true
- }
- },
- {
- "type": "divider"
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "*Server Name*\n${servername}"
- }
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "*Information*\n${alertmessage}"
- }
- },
- {
- "type": "section",
- "fields": [
- {
- "type": "mrkdwn",
- "text": "*Game*\n${gamename}"
- },
- {
- "type": "mrkdwn",
- "text": "*Server IP*\n\`${alertip}:${port}\`"
- },
- {
- "type": "mrkdwn",
- "text": "*Hostname*\n${HOSTNAME}"
- },
- {
- "type": "mrkdwn",
- "text": "*Server Time*\n$(date)"
- }
- ],
- "accessory": {
- "type": "image",
- "image_url": "${alerticon}",
- "alt_text": "cute cat"
- }
- },
- {
- "type": "context",
- "elements": [
- {
- "type": "image",
- "image_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
- "alt_text": "LinuxGSM icon"
- },
- {
- "type": "plain_text",
- "text": "Sent by LinuxGSM ${version}",
- "emoji": true
- }
- ]
- }
- ]
- }
- ]
-}
+ "attachments": [
+ {
+ "color": "${alertcolourhex}",
+ "blocks": [
+ {
+ "type": "header",
+ "text": {
+ "type": "mrkdwn",
+ "text": "${alerttitle}",
+ "emoji": true
+ }
+ },
+ {
+ "type": "divider"
+ },
+ {
+ "type": "section",
+ "text": {
+ "type": "mrkdwn",
+ "text": "*Server Name*\n${servername}"
+ }
+ },
+ {
+ "type": "section",
+ "text": {
+ "type": "mrkdwn",
+ "text": "*Information*\n${alertmessage}"
+ }
+ },
+ {
+ "type": "section",
+ "fields": [
+ {
+ "type": "mrkdwn",
+ "text": "*Game*\n${gamename}"
+ },
+ {
+ "type": "mrkdwn",
+ "text": "*Server IP*\n\`${alertip}:${port}\`"
+ },
+ {
+ "type": "mrkdwn",
+ "text": "*Hostname*\n${HOSTNAME}"
+ },
+ {
+ "type": "mrkdwn",
+ "text": "*Server Time*\n$(date)"
+ }
+ ],
+ "accessory": {
+ "type": "image",
+ "image_url": "${alerticon}",
+ "alt_text": "cute cat"
+ }
+ },
EOF
)
-jsoninfo=$(
+if [ -n "${querytype}" ]; then
+ json+=$(
+ cat << EOF
+ {
+ "type": "section",
+ "text": {
+ "type": "mrkdwn",
+ "text": "*Is my Game Server Online?*\n"
+ }
+ },
+EOF
+ )
+fi
+
+if [ -n "${alerturl}" ]; then
+ json+=$(
+ cat << EOF
+ {
+ "type": "section",
+ "text": {
+ "type": "mrkdwn",
+ "text": "*More info*\n<${alerturl}|${alerturl}>"
+ }
+ },
+EOF
+ )
+fi
+
+json+=$(
cat << EOF
-{
- "attachments": [
- {
- "color": "${alertcolourhex}",
- "blocks": [
- {
- "type": "header",
- "text": {
- "type": "mrkdwn",
- "text": "${alerttitle}",
- "emoji": true
- }
- },
- {
- "type": "divider"
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "*Server Name*\n${servername}"
- }
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "*Information*\n${alertmessage}"
- }
- },
- {
- "type": "section",
- "fields": [
- {
- "type": "mrkdwn",
- "text": "*Game*\n${gamename}"
- },
- {
- "type": "mrkdwn",
- "text": "*Server IP*\n\`${alertip}:${port}\`"
- },
- {
- "type": "mrkdwn",
- "text": "*Hostname*\n${HOSTNAME}"
- },
- {
- "type": "mrkdwn",
- "text": "*Server Time*\n$(date)"
- }
- ],
- "accessory": {
- "type": "image",
- "image_url": "${alerticon}",
- "alt_text": "cute cat"
- }
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "*Server Time*\n${alertmessage}"
- }
- },
- {
- "type": "context",
- "elements": [
- {
- "type": "image",
- "image_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
- "alt_text": "LinuxGSM icon"
- },
- {
- "type": "plain_text",
- "text": "Sent by LinuxGSM ${version}",
- "emoji": true
- }
- ]
- }
- ]
- }
- ]
+ {
+ "type": "context",
+ "elements": [
+ {
+ "type": "image",
+ "image_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
+ "alt_text": "LinuxGSM icon"
+ },
+ {
+ "type": "plain_text",
+ "text": "Sent by LinuxGSM ${version}",
+ "emoji": true
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
EOF
)
-if [ -z "${alerturl}" ]; then
- json="${jsonnoinfo}"
-else
- json="${jsoninfo}"
-fi
-
fn_print_dots "Sending Slack alert"
slacksend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}")
diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh
index 98e1a980b..e504c62bb 100644
--- a/lgsm/modules/alert_telegram.sh
+++ b/lgsm/modules/alert_telegram.sh
@@ -7,38 +7,41 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
-jsoninfo=$(
+json=$(
cat << EOF
{
- "chat_id": "${telegramchatid}",
- "message_thread_id": "${telegramthreadid}",
- "parse_mode": "HTML",
- "disable_notification": "${telegramdisablenotification}",
- "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)",
- "disable_web_page_preview": "yes"
-}
+ "chat_id": "${telegramchatid}",
+ "message_thread_id": "${telegramthreadid}",
+ "parse_mode": "HTML",
+ "disable_notification": "${telegramdisablenotification}",
+ "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n
EOF
)
-jsonnoinfo=$(
+if [ -n "${querytype}" ]; then
+ json+=$(
+ cat << EOF
+Is my Game Server Online?\nCheck here\n\n
+EOF
+ )
+fi
+
+if [ -n "${alerturl}" ]; then
+ json+=$(
+ cat << EOF
+More info\n${alerturl}\n\n
+EOF
+ )
+fi
+
+json+=$(
cat << EOF
-{
- "chat_id": "${telegramchatid}",
- "message_thread_id": "${telegramthreadid}",
- "parse_mode": "HTML",
- "disable_notification": "${telegramdisablenotification}",
- "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)",
- "disable_web_page_preview": "yes"
+Server Time\n$(date)",
+ "disable_web_page_preview": "yes"
}
EOF
)
-if [ -z "${alerturl}" ]; then
- json="${jsonnoinfo}"
-else
- json="${jsoninfo}"
-fi
-
fn_print_dots "Sending Telegram alert"
telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code")
diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh
index 9bab0cbb7..c1d208691 100644
--- a/lgsm/modules/info_messages.sh
+++ b/lgsm/modules/info_messages.sh
@@ -66,6 +66,11 @@ fn_info_messages_head() {
echo -e "Hostname"
echo -e "${HOSTNAME}"
echo -e ""
+ if [ -n "${querytype}" ]; then
+ echo -e "Is my Game Server Online?"
+ echo -e "https://ismygameserver.online/${querytype}/${alertip}:${queryport}"
+ echo -e ""
+ fi
echo -e "Server Time"
echo -e "$(date)"
}