Skip to content

Commit d72d6e3

Browse files
authored
Merge pull request #46 from buildplan/fail2ban-fix
fail2ban fix
2 parents 831265c + 46fed57 commit d72d6e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

du_setup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,12 @@ EOF
11821182
echo "$UFW_PROBES_CONFIG" > "$UFW_FILTER_PATH"
11831183
echo "$JAIL_LOCAL_CONFIG" > "$JAIL_LOCAL_PATH"
11841184

1185+
# --- Ensure the log file exists BEFORE restarting the service ---
1186+
if [[ ! -f /var/log/ufw.log ]]; then
1187+
touch /var/log/ufw.log
1188+
print_info "Created empty /var/log/ufw.log to ensure Fail2Ban starts correctly."
1189+
fi
1190+
11851191
# --- Restart and Verify Fail2ban ---
11861192
print_info "Enabling and restarting Fail2Ban to apply new rules..."
11871193
systemctl enable fail2ban

0 commit comments

Comments
 (0)