From 5355c24b491b84ea0ebeaad99c47b85a85a4241e Mon Sep 17 00:00:00 2001 From: Phil! Gold Date: Mon, 17 Oct 2016 10:04:03 -0400 Subject: [PATCH] `hostname -I` returns all values on one line. --- plugins/senderbase/senderbase | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/senderbase/senderbase b/plugins/senderbase/senderbase index 77a55bad..921c056f 100755 --- a/plugins/senderbase/senderbase +++ b/plugins/senderbase/senderbase @@ -16,9 +16,11 @@ track their current reputation score. =head1 CONFIGURATION -By default, the script will use the first IP address returned by C. -If that's not the right address to use, set the C environment -variable to the appropriate value. +By default, the script will use the first IP address returned by +C. If that's not the right address to use, set the +C environment variable to the appropriate value. (Note that +if a host has multiple IP addresses, there's no guaranteed ordering for +C, so you should set the address explicitly in that case.) [senderbase] env.ip_address 8.8.8.8 @@ -40,7 +42,7 @@ This plugin is made available under a CC0 waiver: =cut -real_ip_address=${ip_address:-$(hostname -I | head -1)} +real_ip_address=${ip_address:-$(hostname -I | awk '{print $1}')} ip_reversed=$(echo $real_ip_address | sed -re 's/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/\4.\3.\2.\1/') query_host=${ip_reversed}.rf.senderbase.org