From f2f8b983c3ea37f8962e77de2cc08e42d1c43a75 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 13 Jun 2014 09:35:41 -0700 Subject: [PATCH] replace ifconfig with ip --- xCAT-genesis-builder/restart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-builder/restart b/xCAT-genesis-builder/restart index 19a624f6e..2a235c788 100755 --- a/xCAT-genesis-builder/restart +++ b/xCAT-genesis-builder/restart @@ -44,8 +44,10 @@ while [ $WAITING -gt 0 ]; do done WAITING=0 if [ ! -z "$FORCENICS" ]; then - for nic in `ifconfig|grep HWaddr|awk '{print $1}'|egrep "$FORCENICS"`; do - if ! ifconfig $nic|grep "inet addr" > /dev/null; then + #for nic in `ifconfig|grep HWaddr|awk '{print $1}'|egrep "$FORCENICS"`; do + for nic in `ip -oneline link show |grep -i ether |awk -F ':' '{print $2}'|grep -o "[^ ]\+\( \+[^ ]\+\)*"|egrep "$FORCENICS"`; do + # if ! ifconfig $nic|grep "inet addr" > /dev/null; then + if ! ip -4 -oneline addr show $nic|grep -i inet > /dev/null; then WAITING=1 fi done