From 8f36c7002bf4c0cfb32d1fb5454e4ed9232bbc34 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 14 Apr 2013 18:40:36 +0000 Subject: Test for the IP address on local interfaces only, if it is not prefixed by an interface name --- ezjail-admin | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ezjail-admin b/ezjail-admin index 950c708..91ae1f6 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -732,15 +732,19 @@ EOF # TIFS=${IFS}; IFS=, - for ezjail_ip in ${ezjail_ips}; do + for ezjail_ip_in in ${ezjail_ips}; do # From 9.0 IP addresses can be prefixed by their interface, for now ignore # the prefix - ezjail_ip="${ezjail_ip#*|}" - - case ${ezjail_ip} in *.*.*.*) _ping=ping;; *) _ping=ping6;; esac - # check, whether IP is configured on a local interface, warn if it isnt - ${_ping} -S ${ezjail_ip} -q -c 1 localhost >/dev/null 2>/dev/null - [ $? -eq 0 ] || echo "Warning: IP ${ezjail_ip} not configured on a local interface." + ezjail_ip="${ezjail_ip_in#*|}" + + # If the IP address is not automatically configured, test if it is configured + # on a local interface + if [ "${ezjail_ip}" = "${ezjail_ip_in}" ]; then + case ${ezjail_ip} in *.*.*.*) _ping=ping;; *) _ping=ping6;; esac + # check, whether IP is configured on a local interface, warn if it isnt + ${_ping} -S ${ezjail_ip} -q -c 1 localhost >/dev/null 2>/dev/null + [ $? -eq 0 ] || echo "Warning: IP ${ezjail_ip} not configured on a local interface." + fi # check, whether some host system services do listen on the Jails IP IFS=_ -- cgit v1.2.3