On 12/22/14 at 04:02pm, Dave Young wrote:
Hi, Minfei
On 12/15/14 at 11:20am, Minfei Huang wrote:
> Add the new lib which checks the ip/domain which you give. Return true,
> if the parameter is ipv6, otherwise return false.
>
> Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
> ---
> kdump-lib.sh | 24 +++++++++++++++++++-----
> 1 file changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/kdump-lib.sh b/kdump-lib.sh
> index b886c5d..acb085e 100755
> --- a/kdump-lib.sh
> +++ b/kdump-lib.sh
> @@ -170,10 +170,26 @@ get_remote_host()
> echo $_config_val
> }
>
> +get_ip_address()
> +{
> + local _server=$1 _server_tmp
> +
> + _server_tmp=$_server
> + _server=`getent ahosts $_server | head -n 1 | cut -d' ' -f1`
> + _server=${_server:-$_server_tmp}
> + echo $_server
> +}
> +
> +is_ipv6_address()
> +{
> + local _server=$(get_ip_address $1)
> + echo $_server | grep -q ":"
> +}
> +
> # check the remote server ip address tpye
> is_ipv6_target()
> {
> - local _server _server_tmp
> + local _server
>
> if is_ssh_dump_target; then
> _server=`get_option_value ssh`
> @@ -183,8 +199,6 @@ is_ipv6_target()
>
> [ -z "$_server" ] && return 1
> _server=`get_remote_host $_server`
> - _server_tmp=$_server
> - _server=`getent ahosts $_server | head -n 1 | cut -d' ' -f1`
> - _server=${_server:-$_server_tmp}
> - echo $_server | grep -q ":"
> +
> + echo $(get_ip_address $_server) | grep -q ":"
> }
Logically this should be the first patch in the series since patch 1/4
is using the function is_ipv6_target
The next patch will use the function is_ipv6_address, so I modify the
function is_ipv6_target to re-use the code. And there is no bussiness
with the previous patch which uses function is_ipv6_target.
Thanks
Minfei
> --
> 1.8.3.1
>
> _______________________________________________
> kexec mailing list
> kexec(a)lists.fedoraproject.org
>
https://lists.fedoraproject.org/mailman/listinfo/kexec