diff options
author | erdgeist <erdgeist@erdgeist.org> | 2013-04-14 17:49:55 +0000 |
---|---|---|
committer | erdgeist <erdgeist@erdgeist.org> | 2013-04-14 17:49:55 +0000 |
commit | 0832cfa91d3f032acf70e600d7e3d3db9c9c4c9b (patch) | |
tree | 19c7efc78c1a68fac7713bfd4268ebd2f301d711 | |
parent | 187a3af93488df36fe89d6f79eb7da6ecba0c0d7 (diff) |
If jail IPs are specified with an interface prefix, drop it for display and test functions
-rwxr-xr-x | ezjail-admin | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ezjail-admin b/ezjail-admin index 680845b..950c708 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -733,6 +733,10 @@ EOF | |||
733 | 733 | ||
734 | TIFS=${IFS}; IFS=, | 734 | TIFS=${IFS}; IFS=, |
735 | for ezjail_ip in ${ezjail_ips}; do | 735 | for ezjail_ip in ${ezjail_ips}; do |
736 | # From 9.0 IP addresses can be prefixed by their interface, for now ignore | ||
737 | # the prefix | ||
738 | ezjail_ip="${ezjail_ip#*|}" | ||
739 | |||
736 | case ${ezjail_ip} in *.*.*.*) _ping=ping;; *) _ping=ping6;; esac | 740 | case ${ezjail_ip} in *.*.*.*) _ping=ping;; *) _ping=ping6;; esac |
737 | # check, whether IP is configured on a local interface, warn if it isnt | 741 | # check, whether IP is configured on a local interface, warn if it isnt |
738 | ${_ping} -S ${ezjail_ip} -q -c 1 localhost >/dev/null 2>/dev/null | 742 | ${_ping} -S ${ezjail_ip} -q -c 1 localhost >/dev/null 2>/dev/null |
@@ -860,7 +864,7 @@ list) | |||
860 | TIFS=${IFS}; IFS=,; unset _multiline | 864 | TIFS=${IFS}; IFS=,; unset _multiline |
861 | for ezjail_ip in ${ezjail_ips:="-"}; do | 865 | for ezjail_ip in ${ezjail_ips:="-"}; do |
862 | if [ -z "${_multiline}" ]; then | 866 | if [ -z "${_multiline}" ]; then |
863 | printf "%-3s %-4s %-15s %-30s %s\\n" "${ezjail_state}" "${ezjail_id:-N/A}" "${ezjail_ip}" "${ezjail_hostname}" "${ezjail_rootdir}" | 867 | printf "%-3s %-4s %-15s %-30s %s\\n" "${ezjail_state}" "${ezjail_id:-N/A}" "${ezjail_ip#*|}" "${ezjail_hostname}" "${ezjail_rootdir}" |
864 | _multiline=yes | 868 | _multiline=yes |
865 | else | 869 | else |
866 | printf " %-4s %s\\n" "${ezjail_id:-N/A}" "${ezjail_ip}" | 870 | printf " %-4s %s\\n" "${ezjail_id:-N/A}" "${ezjail_ip}" |