2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 11:42:05 +00:00

Avoid use command route in configeth, since it is obsoleted

This commit is contained in:
GONG Jie 2018-08-01 14:37:02 +08:00
parent 738e5c8814
commit 72f99de607

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