diff options
author | sebres <serg.brester@sebres.de> | 2017-03-30 13:02:37 +0200 |
---|---|---|
committer | sebres <serg.brester@sebres.de> | 2017-03-30 13:02:37 +0200 |
commit | 97e8b42d342c437d27d43fa4ed136c11a5fa1be4 (patch) | |
tree | dbb769ed696119f04a17aec8ed9ecfcc315ddaa8 /config/action.d/dummy.conf | |
parent | 042a060a54ed517e91496073fb8f7ad66ee7a78e (diff) | |
download | fail2ban-97e8b42d342c437d27d43fa4ed136c11a5fa1be4.tar.gz |
dummy action extended with more examples and test-covered now
Diffstat (limited to 'config/action.d/dummy.conf')
-rw-r--r-- | config/action.d/dummy.conf | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/config/action.d/dummy.conf b/config/action.d/dummy.conf index dc4e1dbf..41250c27 100644 --- a/config/action.d/dummy.conf +++ b/config/action.d/dummy.conf @@ -10,14 +10,23 @@ # Notes.: command executed once at the start of Fail2Ban. # Values: CMD # -actionstart = touch /var/run/fail2ban/fail2ban.dummy - printf %%b "<init>\n" >> /var/run/fail2ban/fail2ban.dummy +actionstart = if [ ! -z '<target>' ]; then touch <target>; fi; + printf %%b "<init>\n" <to_target> + echo "%(debug)s started" + +# Option: actionflush +# Notes.: command executed once to flush (clear) all IPS, by shutdown (resp. by stop of the jail or this action) +# Values: CMD +# +actionflush = printf %%b "-*\n" <to_target> + echo "%(debug)s clear all" # Option: actionstop # Notes.: command executed once at the end of Fail2Ban # Values: CMD # -actionstop = rm -f /var/run/fail2ban/fail2ban.dummy +actionstop = if [ ! -z '<target>' ]; then rm -f <target>; fi; + echo "%(debug)s stopped" # Option: actioncheck # Notes.: command executed once before each actionban command @@ -31,7 +40,8 @@ actioncheck = # Tags: See jail.conf(5) man page # Values: CMD # -actionban = printf %%b "+<ip>\n" >> /var/run/fail2ban/fail2ban.dummy +actionban = printf %%b "+<ip>\n" <to_target> + echo "%(debug)s banned <ip> (family: <family>)" # Option: actionunban # Notes.: command executed when unbanning an IP. Take care that the @@ -39,9 +49,15 @@ actionban = printf %%b "+<ip>\n" >> /var/run/fail2ban/fail2ban.dummy # Tags: See jail.conf(5) man page # Values: CMD # -actionunban = printf %%b "-<ip>\n" >> /var/run/fail2ban/fail2ban.dummy +actionunban = printf %%b "-<ip>\n" <to_target> + echo "%(debug)s unbanned <ip> (family: <family>)" + + +debug = [<name>] <actname> <target> -- [Init] init = 123 +target = /var/run/fail2ban/fail2ban.dummy +to_target = >> <target> |