From e27b5ec5987002557b2bc4b5237b027f8cd64857 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Wed, 2 Aug 2017 17:36:48 +0800 Subject: [PATCH] fix configeth get netmask in postscript (#3597) --- xCAT/postscripts/configeth | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index f57e84305..fa147ef06 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -487,9 +487,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