From f96ef24a00ed4925432f0aabd7354cdbaaad597b Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Mon, 19 Feb 2024 16:41:17 -0500 Subject: [PATCH] Only broadcast valid messages --- scripts/helper_functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/helper_functions.sh b/scripts/helper_functions.sh index efeb5c34b..96db82ad2 100644 --- a/scripts/helper_functions.sh +++ b/scripts/helper_functions.sh @@ -179,9 +179,9 @@ broadcast_command() { # Replaces spaces with underscore local message="${1// /_}" if [[ $TEXT = *[![:ascii:]]* ]]; then - LogWarn "Broadcast message contains non-ascii characters: \"${message}\"" - fi - if ! RCON "broadcast ${message}"; then + LogWarn "Unable to broadcast since the message contains non-ascii characters: \"${message}\"" + return_val=1 + elif ! RCON "broadcast ${message}"; then return_val=1 fi return "$return_val"