sécurité root
This commit is contained in:
@@ -19,6 +19,13 @@ CRITICAL=95
|
||||
MOUNTS=("/" "/var" "/home")
|
||||
LOG_BIN="/opt/monitoring/bin/log-cli.php"
|
||||
|
||||
# --- Vérification ROOT ---
|
||||
if [ "${EUID}" -ne 0 ]; then
|
||||
echo "ERREUR : Ce script doit être exécuté en tant que root." >&2
|
||||
$LOG_BIN ERROR "internal_error" "Tentative d'exécution sans privilèges root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for mount in "${MOUNTS[@]}"; do
|
||||
if ! mountpoint -q "$mount"; then continue; fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user