2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 12:20:40 +00:00

Merge pull request #5449 from neo954/configeth

Avoid use command route in configeth, since it is obsoleted
This commit is contained in:
Yuan Bai
2018-08-02 09:25:08 +08:00
committed by GitHub

View File

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