# --- Date de scan --- print_clamav_last_run() { local mount=$1 local base if [ "$mount" = "/" ]; then base="_" else base=$(basename "$mount") fi local ts_file="/var/log/clamscan-last-${base}.timestamp" local color=$GREEN local last_run="never" if [ -f "$ts_file" ]; then last_run=$(cat "$ts_file") local last_epoch=$(date -d "$last_run" +%s) local now_epoch=$(date +%s) local age_hours=$(( (now_epoch - last_epoch) / 3600 )) if [ "$age_hours" -le 24 ]; then color=$GREEN elif [ "$age_hours" -le 72 ]; then color=$ORANGE else color=$RED fi else color=$RED fi # Affichage : "root" explicite pour / local label="$mount" [ "$mount" = "/" ] && label="/ (root)" # Alignement propre sur 12 + 19 caractères printf " ClamAV last scan on %-12s : ${color}%-19s${RESET}\n" "$label" "$last_run" }