mirror of https://github.com/fail2ban/fail2ban
lets see an error (with debug messages) in debug case
parent
3d23a44bb1
commit
85cfb81782
|
@ -46,6 +46,11 @@ actionban = oifs=${IFS};
|
||||||
if [ "<debug>" -gt 0 ]; then echo "try to resolve $RESOLVER_ADDR"; fi
|
if [ "<debug>" -gt 0 ]; then echo "try to resolve $RESOLVER_ADDR"; fi
|
||||||
ADDRESSES=$(dig +short -t txt -q $RESOLVER_ADDR | grep -v ';;' | tr -d '"')
|
ADDRESSES=$(dig +short -t txt -q $RESOLVER_ADDR | grep -v ';;' | tr -d '"')
|
||||||
if [ "<debug>" -gt 0 ]; then echo "returned address $ADDRESSES"; fi
|
if [ "<debug>" -gt 0 ]; then echo "returned address $ADDRESSES"; fi
|
||||||
|
if [ -z "$ADDRESSES" ]; then
|
||||||
|
echo "address for $RESOLVER_ADDR cannot be found or timeout from dig";
|
||||||
|
if [ "<debug>" -gt 0 ]; then exit 1; fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
IFS=,; ADDRESSES=$(echo $ADDRESSES)
|
IFS=,; ADDRESSES=$(echo $ADDRESSES)
|
||||||
IFS=${oifs}
|
IFS=${oifs}
|
||||||
IP=<ip>
|
IP=<ip>
|
||||||
|
@ -56,13 +61,11 @@ actionban = oifs=${IFS};
|
||||||
TLP=<tlp>
|
TLP=<tlp>
|
||||||
PORT=<port>
|
PORT=<port>
|
||||||
DATE=`LC_ALL=C date --date=@<time> +"%%a, %%d %%h %%Y %%T %%z"`
|
DATE=`LC_ALL=C date --date=@<time> +"%%a, %%d %%h %%Y %%T %%z"`
|
||||||
if [ ! -z "$ADDRESSES" ]; then
|
oifs=${IFS}; IFS=,; ADDRESSES=$(echo $ADDRESSES)
|
||||||
oifs=${IFS}; IFS=,; ADDRESSES=$(echo $ADDRESSES)
|
IFS=${oifs}
|
||||||
IFS=${oifs}
|
(printf -- %%b "<header>\n<message>\n<report>\n\n";
|
||||||
(printf -- %%b "<header>\n<message>\n<report>\n\n";
|
date '+Note: Local timezone is %%z (%%Z)';
|
||||||
date '+Note: Local timezone is %%z (%%Z)';
|
printf -- %%b "\n<ipmatches>\n\n<footer>") | <mailcmd> <mailargs> $ADDRESSES
|
||||||
printf -- %%b "\n<ipmatches>\n\n<footer>") | <mailcmd> <mailargs> $ADDRESSES
|
|
||||||
fi
|
|
||||||
|
|
||||||
actionunban =
|
actionunban =
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue