2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

fix configeth get netmask in postscript (#3597)

This commit is contained in:
Yuan Bai 2017-08-02 17:36:48 +08:00 committed by yangsong
parent 192ce780bc
commit e27b5ec598

View File

@ -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