Correct third-segment length check. Fix undefined variable in failure logging

This commit is contained in:
mgutt
2025-09-13 00:23:10 +02:00
committed by ljm42
parent 4dfd3040df
commit 5eb2fb7a33

View File

@@ -80,7 +80,7 @@ if [[ "${FULL_DETAILS}" ]]; then
DESC_FIELD="${FULL_DETAILS:0:1024}"
if [[ ${#FULL_DETAILS} -gt 1024 ]]; then
DESC_FIELD2="${FULL_DETAILS:1024:1024}"
if [[ ${#FULL_DETAILS} -gt 1024 ]]; then
if [[ ${#FULL_DETAILS} -gt 2048 ]]; then
DESC_FIELD3="${FULL_DETAILS:2048:1024}"
fi
fi
@@ -210,14 +210,14 @@ for ((i=1; i<=MAX; i++)); do
# if there was an error with the submission, log details and exit loop
if [[ "$ret" != *"retry_after"* ]]; then
echo "$payload" >>"$LOG"
echo "$data_binary" >>"$LOG"
logger -t "$SCRIPTNAME" -- "Failed sending notification"
break
fi
# if retries exhausted, log failure
if (( i == MAX )); then
echo "$payload" >>"$LOG"
echo "$data_binary" >>"$LOG"
logger -t "$SCRIPTNAME" -- "Failed sending notification - rate limited"
break
fi