|
@ -5,6 +5,10 @@ |
|
|
# Website: https://gameservermanagers.com |
|
|
# Website: https://gameservermanagers.com |
|
|
# Description: Sends Discord alert including the server status. |
|
|
# Description: Sends Discord alert including the server status. |
|
|
|
|
|
|
|
|
|
|
|
local commandname="ALERT" |
|
|
|
|
|
local commandaction="Alert" |
|
|
|
|
|
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
|
|
|
|
|
|
|
json=$(cat <<EOF |
|
|
json=$(cat <<EOF |
|
|
{ |
|
|
{ |
|
|
"username":"LinuxGSM", |
|
|
"username":"LinuxGSM", |
|
@ -51,8 +55,14 @@ json=$(cat <<EOF |
|
|
EOF |
|
|
EOF |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
#curl -X POST --data "Content-Type: application/json" -X POST -d """${json}""" "${discordwebhook}" |
|
|
fn_print_dots "Sending Discord alert" |
|
|
|
|
|
sleep 0.5 |
|
|
|
|
|
discordsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${discordwebhook}) |
|
|
|
|
|
|
|
|
echo "$json" >f |
|
|
if [ -n "${discordsend}" ]; then |
|
|
curl -v -X POST --data @f ${discordwebhook} |
|
|
fn_print_fail_nl "Sending Discord alert: ${discordsend}" |
|
|
|
|
|
fn_script_log_fatal "Sending Discord alert: ${discordsend}" |
|
|
|
|
|
else |
|
|
|
|
|
fn_print_ok_nl "Sending Discord alert" |
|
|
|
|
|
fn_script_log_pass "Sending Discord alert" |
|
|
|
|
|
fi |
|
|