From 0832cfa91d3f032acf70e600d7e3d3db9c9c4c9b Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 14 Apr 2013 17:49:55 +0000 Subject: If jail IPs are specified with an interface prefix, drop it for display and test functions --- ezjail-admin | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ezjail-admin b/ezjail-admin index 680845b..950c708 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -733,6 +733,10 @@ EOF TIFS=${IFS}; IFS=, for ezjail_ip 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 @@ -860,7 +864,7 @@ list) TIFS=${IFS}; IFS=,; unset _multiline for ezjail_ip in ${ezjail_ips:="-"}; do if [ -z "${_multiline}" ]; then - printf "%-3s %-4s %-15s %-30s %s\\n" "${ezjail_state}" "${ezjail_id:-N/A}" "${ezjail_ip}" "${ezjail_hostname}" "${ezjail_rootdir}" + printf "%-3s %-4s %-15s %-30s %s\\n" "${ezjail_state}" "${ezjail_id:-N/A}" "${ezjail_ip#*|}" "${ezjail_hostname}" "${ezjail_rootdir}" _multiline=yes else printf " %-4s %s\\n" "${ezjail_id:-N/A}" "${ezjail_ip}" -- cgit v1.2.3