From 72f99de6079b377a44bf6be0d3f16f773ae0f231 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 1 Aug 2018 14:37:02 +0800 Subject: [PATCH] Avoid use command route in configeth, since it is obsoleted --- xCAT/postscripts/configeth | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 466cc8167..128784cab 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -451,9 +451,9 @@ elif [ "$1" = "-s" ];then if [ ! -z "${inst_nic}" ];then str_inst_ip=`ip -4 -o addr|grep -i ${inst_nic} |awk '{print $4}'|awk -F/ '{print $1}'` if [ ! -z "$str_inst_ip" ];then - inst_ip_pre=`ip ro ls|grep -i ${str_inst_ip}|awk '{print $1}'|awk -F/ '{print $1}'` - if [ ! -z "$inst_ip_pre" ];then - str_inst_mask=`route |grep ^${inst_ip_pre}|awk '{print $3}'|head -1` + inst_prefix=`ip ro ls|grep -i ${str_inst_ip}|awk '{print $1}'|awk -F/ '{print $2}'` + if [ ! -z "$inst_prefix" ];then + str_inst_mask=`v4prefix2mask $inst_prefix` fi fi fi @@ -473,9 +473,9 @@ elif [ "$1" = "-s" ];then if [ ! -z "${inst_nic}" ];then str_inst_ip=`ip -4 -o addr|grep -i ${inst_nic} |awk '{print $4}'|awk -F/ '{print $1}'` if [ ! -z "$str_inst_ip" ];then - inst_ip_pre=`ip ro ls|grep -i ${str_inst_ip}|awk '{print $1}'|awk -F/ '{print $1}'` - if [ ! -z "$inst_ip_pre" ];then - str_inst_mask=`route |grep ^${inst_ip_pre}|awk '{print $3}'|head -1` + inst_prefix=`ip ro ls|grep -i ${str_inst_ip}|awk '{print $1}'|awk -F/ '{print $2}'` + if [ ! -z "$inst_prefix" ];then + str_inst_mask=`v4prefix2mask $inst_prefix` fi fi fi