File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,25 @@ json=$(
4646 "name": "Server Time",
4747 "value": "$( date) ",
4848 "inline": true
49- },
49+ }
50+ EOF
51+ )
52+
53+ if [ -n " ${querytype} " ]; then
54+ json+=$(
55+ cat << EOF
56+ ,
5057 {
5158 "name": "Is my Game Server Online?",
5259 "value": "https://ismygameserver.online/${imgsoquerytype} /${alertip} :${queryport} ",
5360 "inline": true
5461 }
62+ EOF
63+ )
64+ fi
65+
66+ json+=$(
67+ cat << EOF
5568 ],
5669 "footer": {
5770 "icon_url": "https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /lgsm/data/alert_discord_logo.jpg",
@@ -63,6 +76,8 @@ json=$(
6376EOF
6477)
6578
79+ echo " ${json} "
80+
6681fn_print_dots " Sending Discord alert"
6782
6883discordsend=$( curl --connect-timeout 3 -sSL -H " Content-Type: application/json" -X POST -d " $( echo -n " ${json} " | jq -c .) " " ${discordwebhook} " )
You can’t perform that action at this time.
0 commit comments