From 80291f4473259db206911e3f54023a13c90f3e93 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Tue, 8 Oct 2013 01:45:23 -0700 Subject: [PATCH] bug 3808: error info when running confignics --- xCAT/postscripts/configeth | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index b29c8f1b5..356dbb872 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -784,9 +784,13 @@ else num_ipv4_index=0 num_ipv6_index=0 num_index=0 - cat $str_his_file | grep $str_nic_name - if [ $? -ne 0 ];then - echo "${str_nic_name}" >> $str_his_file + if [ -e "$str_his_file" ];then + grep $str_nic_name $str_his_file + if [ $? -ne 0 ];then + echo "${str_nic_name}" >> $str_his_file + fi + else + echo "${str_nic_name}" > $str_his_file fi #delete the old alias configuration files on redhat if [ "$str_os_type" = "redhat" ];then