diff options
author | erdgeist <erdgeist@erdgeist.org> | 2013-04-14 18:40:36 +0000 |
---|---|---|
committer | erdgeist <erdgeist@erdgeist.org> | 2013-04-14 18:40:36 +0000 |
commit | 8f36c7002bf4c0cfb32d1fb5454e4ed9232bbc34 (patch) | |
tree | c66b2e97d3417d148ef49dc44e62576168721c28 | |
parent | c7a82d99e1fa759a0766c6b42f8bcc046d21a86a (diff) |
Test for the IP address on local interfaces only, if it is not prefixed by an interface name
-rwxr-xr-x | ezjail-admin | 18 |
1 files 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 | |||
732 | # | 732 | # |
733 | 733 | ||
734 | TIFS=${IFS}; IFS=, | 734 | TIFS=${IFS}; IFS=, |
735 | for ezjail_ip in ${ezjail_ips}; do | 735 | for ezjail_ip_in in ${ezjail_ips}; do |
736 | # From 9.0 IP addresses can be prefixed by their interface, for now ignore | 736 | # From 9.0 IP addresses can be prefixed by their interface, for now ignore |
737 | # the prefix | 737 | # the prefix |
738 | ezjail_ip="${ezjail_ip#*|}" | 738 | ezjail_ip="${ezjail_ip_in#*|}" |
739 | 739 | ||
740 | case ${ezjail_ip} in *.*.*.*) _ping=ping;; *) _ping=ping6;; esac | 740 | # If the IP address is not automatically configured, test if it is configured |
741 | # check, whether IP is configured on a local interface, warn if it isnt | 741 | # on a local interface |
742 | ${_ping} -S ${ezjail_ip} -q -c 1 localhost >/dev/null 2>/dev/null | 742 | if [ "${ezjail_ip}" = "${ezjail_ip_in}" ]; then |
743 | [ $? -eq 0 ] || echo "Warning: IP ${ezjail_ip} not configured on a local interface." | 743 | case ${ezjail_ip} in *.*.*.*) _ping=ping;; *) _ping=ping6;; esac |
744 | # check, whether IP is configured on a local interface, warn if it isnt | ||
745 | ${_ping} -S ${ezjail_ip} -q -c 1 localhost >/dev/null 2>/dev/null | ||
746 | [ $? -eq 0 ] || echo "Warning: IP ${ezjail_ip} not configured on a local interface." | ||
747 | fi | ||
744 | 748 | ||
745 | # check, whether some host system services do listen on the Jails IP | 749 | # check, whether some host system services do listen on the Jails IP |
746 | IFS=_ | 750 | IFS=_ |