On 28.8.2015 at 8:51 PM, "Iosif Fettich" <[email protected]> wrote:
>is that kind of indentation\continuation lines OK?

I do think it is. The command is executed as we would expect.

In the meantime, I found that the "SEP_IP=( <ip> )" closing paren might be the 
one causing the syntax error. It is a syntax error in sh, it is not in bash.

So, my current try is to get rid of the SEP_IP/IFS/set approach entirely.

------
actionban = ABUSIXADDRESS=$(echo -n "<ip>" | awk 'BEGIN { FS="." } { print 
$4"."$3"."$2"."$1".abuse-contacts.abusix.org"; }'); ADDRESSES=$(dig +short -t 
txt -q $ABUSIXADDRESS); ADDRESSLIST=$(echo -n $ADDRESSES | sed -e 's/,/" "/;')
            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>
------

which results in e-mails to me (Woo-hoo!), but in the mails the ADDRESSES and 
ADDRESSLIST variables are empty (D'oh!) ... whereas issued from the command 
line, the dig yields an address. Hmph.

w6g


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

Reply via email to