Files
Fail2Ban-Report/Backend/multi/Fail2Ban-Report-cronscript.sh
2025-08-25 21:06:04 +02:00

25 lines
587 B
Bash
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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
# Fail2Ban-Report-cronscript.sh
LOGFILE="/opt/Fail2Ban-Report/cronjobs.log"
echo "start" > $LOGFILE
# Run Information gathering
./fail2ban_log2json.sh > $LOGFILE
# wait 5 seconds
sleep 5
# Run downlod-checker to see if updates available
./download-checker.sh
DOWNLOAD_STATUS=$?
# if there are updates
if [ $DOWNLOAD_STATUS -eq 0 ]; then
echo "✅ Found Updates, running sync cycle" > $LOGFILE
./firewall-update.sh > $LOGFILE
./syncback.sh > $LOGFILE
else
echo " No Updates, no need to run firewall and syncback" > $LOGFILE
fi
echo "done" > $LOGFILE