From de876776366cb95b4351011a0eec740eb4d0d34b Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 30 Jun 2016 01:24:44 -0400 Subject: [PATCH] fix 1439 confignics fails on CentOS 7.2 --- xCAT/postscripts/configeth | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 6e82999e3..94b3fea5e 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -425,9 +425,9 @@ elif [ "$1" = "-s" ];then inst_nic=`ip -o link |grep -i ${str_inst_mac} |awk '{print $2}'|sed 's/://g'` 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 + 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 + if [ ! -z "$inst_ip_pre" ];then str_inst_mask=`route |grep ^${inst_ip_pre}|awk '{print $3}'|head -1` fi fi @@ -447,9 +447,9 @@ elif [ "$1" = "-s" ];then inst_nic=`ip -o link |grep -i ${str_inst_mac} |awk '{print $2}'|sed 's/://g'` 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 + 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 + if [ ! -z "$inst_ip_pre" ];then str_inst_mask=`route |grep ^${inst_ip_pre}|awk '{print $3}'|head -1` fi fi @@ -459,7 +459,7 @@ elif [ "$1" = "-s" ];then fi fi else - str_lease_file=`ls /var/lib/dhclient/*$str_inst_nic* | grep leases` + str_lease_file=`ls /var/lib/dhclient/*$str_inst_nic* | grep lease` if [ -e "$str_lease_file" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` @@ -470,9 +470,9 @@ elif [ "$1" = "-s" ];then inst_nic=`ip -o link |grep -i ${str_inst_mac} |awk '{print $2}'|sed 's/://g'` 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 + 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 + if [ ! -z "$inst_ip_pre" ];then str_inst_mask=`route |grep ^${inst_ip_pre}|awk '{print $3}'|head -1` fi fi