diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 9bda41b9b..12382706f 100644 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -1,49 +1,47 @@ #!/bin/bash # LinuxGSM alert_discord.sh function # Author: Daniel Gibbs -# Contributor: faflfama +# Contributor: faflfama, diamondburned # Website: https://linuxgsm.com # Description: Sends Discord alert. +if ! command -v jq > /dev/null; then + fn_print_fail_nl "Sending Discord alert: jq is missing." + fn_script_log_fatal "Sending Discord alert: jq is missing." +fi + +escaped_servername="$(echo -n "${servername}" | jq -sRr "@json")" +escaped_alertbody="$(echo -n "${alertbody}" | jq -sRr "@json")" + json=$(cat <