From cb9ac0d4fba31496e3b88265962ed3e4fdda9c99 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Tue, 6 Feb 2018 14:57:54 +0800 Subject: [PATCH] enhance confignetwork -s return code (#4789) * enhance confignetwork -s return code * restart nic when updatenode and postbootscripts * enhance >/dev/null 2>&1 * polished --- xCAT/postscripts/configeth | 4 +++- xCAT/postscripts/confignetwork | 2 +- xCAT/postscripts/nicutils.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 35a1e6c89..d4f528a11 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -640,7 +640,9 @@ elif [ "$1" = "-s" ];then fi fi - ifdown $str_inst_nic;ifup $str_inst_nic + if [ "$UPDATENODE" = "1" ] || grep "REBOOT=TRUE" /opt/xcat/xcatinfo >/dev/null 2>&1; then + ifdown $str_inst_nic;ifup $str_inst_nic + fi if [ $? -ne 0 ]; then log_error "ifup $str_inst_nic failed." error_code=1 diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index f7e60fc88..4e57753b3 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -632,7 +632,7 @@ if [ $boot_install_nic -eq 1 ];then echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" log_info "configure the install nic $installnic. " instnic_conf=1 - configeth -s $installnic |log_lines info + configeth -s $installnic if [ $? -ne 0 ]; then errorcode=1 fi diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 766694e64..ea86d4320 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -77,7 +77,7 @@ function log_lines { function log_error { local __msg="$*" $log_print_cmd $log_print_arg "[E]:Error: $__msg" - return 0 + return 1 } ######################################################