From 78b6e310121552be9081ff205b4ead26c4346836 Mon Sep 17 00:00:00 2001 From: buildplan <170122315+buildplan@users.noreply.github.com> Date: Wed, 6 Aug 2025 14:52:12 +0100 Subject: [PATCH 1/2] Update du_setup.sh --- du_setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/du_setup.sh b/du_setup.sh index 82f0057..85c5dcb 100644 --- a/du_setup.sh +++ b/du_setup.sh @@ -1182,11 +1182,16 @@ EOF echo "$UFW_PROBES_CONFIG" > "$UFW_FILTER_PATH" echo "$JAIL_LOCAL_CONFIG" > "$JAIL_LOCAL_PATH" + # --- Ensure the log file exists BEFORE restarting the service --- + if [[ ! -f /var/log/ufw.log ]]; then + touch /var/log/ufw.log + print_info "Created empty /var/log/ufw.log to ensure Fail2Ban starts correctly." + fi + # --- Restart and Verify Fail2ban --- print_info "Enabling and restarting Fail2Ban to apply new rules..." systemctl enable fail2ban systemctl restart fail2ban - sleep 2 # Give the service a moment to initialize. if systemctl is-active --quiet fail2ban; then print_success "Fail2Ban is active with the new configuration." From 46fed57a686cca5e4df29113b5ce73e9a63c1ee0 Mon Sep 17 00:00:00 2001 From: buildplan <170122315+buildplan@users.noreply.github.com> Date: Wed, 6 Aug 2025 14:54:50 +0100 Subject: [PATCH 2/2] touch ufw log file for fail2ban --- du_setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/du_setup.sh b/du_setup.sh index 85c5dcb..407bf38 100644 --- a/du_setup.sh +++ b/du_setup.sh @@ -1192,6 +1192,7 @@ EOF print_info "Enabling and restarting Fail2Ban to apply new rules..." systemctl enable fail2ban systemctl restart fail2ban + sleep 2 # Give the service a moment to initialize. if systemctl is-active --quiet fail2ban; then print_success "Fail2Ban is active with the new configuration."