fix : code review

This commit is contained in:
AkiNoKure
2026-03-10 15:54:22 +01:00
parent 29eff11b23
commit f72328e0ce
8 changed files with 356 additions and 107 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -u
set -uo pipefail
###############################################################################
# check-statut-recette.sh
@@ -89,8 +89,11 @@ discord_ping() {
msg+="Application: ${site}\n"
msg+="Details: ${detail}"
local payload
payload="$(jq -n --arg content "$msg" '{content: $content}')"
curl -fsS -H "Content-Type: application/json" \
-d "{\"content\":\"$msg\"}" \
-d "$payload" \
"$DISCORD_WEBHOOK_URL" >/dev/null || true
}
@@ -99,11 +102,9 @@ discord_ping() {
#######################################
log_line() {
# 2026-03-04 14:12:33 | LEVEL | site | message
printf "%s | %s | %s | %s\n" \
"$(date +'%Y-%m-%d %H:%M:%S')" "$1" "$2" "$3" | tee -a "$LOG_FILE"
# Envoi Discord par application
discord_ping "$2" "$1" "$3"
}