Skip to content

Commit 198b735

Browse files
authored
Update run to make fail2ban.local consistent with jail.local
Updating /config/fail2ban/jail.local will update its copy in /etc/fail2ban/. Users would expect the same behavior with fail2ban.local
1 parent 59d1c8a commit 198b735

File tree

1 file changed

+5
-1
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-fail2ban-config

1 file changed

+5
-1
lines changed

root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/run

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ cp -R /defaults/fail2ban/action.d /config/fail2ban/
1717
if [[ ! -f /config/fail2ban/jail.local ]]; then
1818
cp /defaults/fail2ban/jail.local /config/fail2ban/jail.local
1919
fi
20+
# if fail2ban.local is missing in /config, copy default
21+
if [[ ! -f /config/fail2ban/fail2ban.local ]]; then
22+
cp /defaults/fail2ban/fail2ban.local /config/fail2ban/fail2ban.local
23+
fi
2024
# Replace fail2ban config with user config
2125
if [[ -d /etc/fail2ban/filter.d ]]; then
2226
rm -rf /etc/fail2ban/filter.d
@@ -26,7 +30,7 @@ if [[ -d /etc/fail2ban/action.d ]]; then
2630
fi
2731
cp -R /config/fail2ban/filter.d /etc/fail2ban/
2832
cp -R /config/fail2ban/action.d /etc/fail2ban/
29-
cp /defaults/fail2ban/fail2ban.local /etc/fail2ban/
33+
cp /config/fail2ban/fail2ban.local /etc/fail2ban/fail2ban.local
3034
cp /config/fail2ban/jail.local /etc/fail2ban/jail.local
3135

3236
# logfiles needed by fail2ban

0 commit comments

Comments
 (0)