On 10/23/14 at 10:47am, Minfei Huang wrote:
From: Arthur Zou <zzou(a)redhat.com>
+# check the remote server ip address tpye
+is_ipv6_target()
+{
+ local _server _server_tmp
+
+ if is_ssh_dump_target; then
+ _server=`get_option_value ssh`
+ elif is_nfs_dump_target; then
+ _server=`get_option_value nfs`
+ fi
+
+ [ -z "$_server" ] && return 1
+ _server=`get_remote_host $_server`
+ _server_tmp=$_server
+ _server=`getent hosts $_server | head -n 1 | cut -d' ' -f1`
We have discussed above line, "getent hosts" will return the ip address
from hostname uncertainly. So we had better use "getent ahosts", it
returns ipv4 address firstly if ipv4 address exist, then returns ipv6
address if ipv4 address doesn't exist.
+ _server=${_server:-$_server_tmp}
+ echo $_server | grep -q ":"
+}
--
1.8.3.1
_______________________________________________
kexec mailing list
kexec(a)lists.fedoraproject.org
https://lists.fedoraproject.org/mailman/listinfo/kexec