diff --git a/scripts/security-scan.sh b/scripts/security-scan.sh index e99bbfc..4241a17 100755 --- a/scripts/security-scan.sh +++ b/scripts/security-scan.sh @@ -23,7 +23,7 @@ ALERTS="" alert() { printf '[%s] %s\n' "$(date '+%F %T')" "$*" | tee -a "$LOG" >&2 - ALERTS="${ALERTS}${*}\n" + printf -v ALERTS '%s%s\n' "$ALERTS" "$*" FINDINGS=$((FINDINGS + 1)) } @@ -36,7 +36,7 @@ notify() { token="$(grep '^NTFY_SI_TOKEN=' "$NTFY_CRED" 2>/dev/null | cut -d= -f2- | tr -d '"' | tr -d '[:space:]')" [ -n "$token" ] || return 0 local body - body="🛡 mozdIT monitoring: ${FINDINGS} eltérés — $(date '+%F %T')\n${ALERTS}" + body="🛡 mozdIT monitoring: ${FINDINGS} eltérés — $(date '+%F %T')"$'\n'"${ALERTS}" curl -s -o /dev/null --max-time 10 \ -H "Authorization: Bearer $token" \ -H "Title: mozdIT biztonsági riasztás" \