zamba-lxc-toolbox/check_zambaconfonpve_trmm.sh

20 lines
548 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
export LC_ALL=C
ZAMBA_CONF="/root/zamba-lxc-toolbox/conf/zamba.conf"
if [[ -f "$ZAMBA_CONF" ]]; then
# Prüfen, ob die Datei älter als 3 Tage ist
if find "$ZAMBA_CONF" -mtime +3 >/dev/null 2>&1; then
echo "⚠️ zamba.conf ist älter als 3 Tage Datei wird gelöscht: $ZAMBA_CONF"
rm -f "$ZAMBA_CONF"
exit 0
else
echo "❌ Problem: zamba.conf ist vorhanden und jünger als 3 Tage: $ZAMBA_CONF"
exit 2
fi
else
echo "✅ OK: zamba.conf ist nicht vorhanden"
exit 0
fi