On 28.8.2015 at 8:20 PM, [email protected] wrote:
>I see that the command line querying abusix.org only works when 
>executed in a bash shell. The sh and csh don't seem to know the 
>${VAR///} replacement pattern. 

And again, the replacement pattern doesn't appear to be the problem; I replaced 
it with a sed command, like

------
actionban = oifs=${IFS}; IFS=.; SEP_IP=( <ip> ); set -- ${SEP_IP}; 
ADDRESSES=$(dig +short -t txt -q $4.$3.$2.$1.abuse-contacts.abusix.org); 
ADDRESSLIST=$(echo ${ADDRESSES} | sed -e 's/,/" "/'); IFS=${oifs}
            printf %%b "Subject: [Fail2Ban] <name>: abuse contact info for <ip>
            Date: `LC_TIME=C date +"%%a, %%d %%h %%Y %%T %%z"`
            From: <sendername> <<sender>>
            To: <dest>\n
            The IP <ip> has the following abuse contacts according to 
abusix.org:\n
            ADDRESSES=${ADDRESSES}\n
            ADDRESSLIST=${ADDRESSLIST}\n\n
            Fail2Ban" | /usr/sbin/sendmail -f <sender> <dest>
------


and the log still says, Syntax error.

------
2015-08-28 20:26:45,719 fail2ban.action         [64959]: ERROR   oifs=${IFS}; 
IFS=.; SEP_IP=( 93.174.95.81 ); set -- ${SEP_IP}; ADDRESSES=$(dig +short -t txt 
-q $4.$3.$2.$1.abuse-contacts.abusix.org); ADDRESSLIST=$(echo ${ADDRESSES} | 
sed -e 's/,/" "/'); IFS=${oifs}
printf %b "Subject: [Fail2Ban] sshd: abuse contact info for 93.174.95.81
Date: `LC_TIME=C date +"%a, %d %h %Y %T %z"`
From: Fail2Ban <[email protected]>
To: [email protected]\n
The IP 93.174.95.81 has the following abuse contacts according to abusix.org:\n
ADDRESSES=${ADDRESSES}\n
ADDRESSLIST=${ADDRESSLIST}\n\n
Fail2Ban" | /usr/sbin/sendmail -f ******@******.de ******@****.de -- stderr: 
'Syntax error: word unexpected (expecting ")")\n'
------

I do hope someone has seen this kind of error before ...

w6g


------------------------------------------------------------------------------
_______________________________________________
Fail2ban-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fail2ban-users

Reply via email to