From d7eb089a6e42f99611c6b7ef33d1a9be21a764d0 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 13 Jun 2014 10:37:18 -0400 Subject: [PATCH] replace ifconfig with ip --- xCAT/postscripts/enablekdump | 3 ++- xCAT/postscripts/hardeths | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 1c6ad2d92..f713c69cf 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -31,7 +31,8 @@ for i in `/bin/cat /proc/cmdline`; do break elif [ "$KEY" = "BOOTIF" ]; then MACX=`/bin/echo $i | /bin/awk -F= '{print $2}'|sed -e s/^01-// -e s/-/:/g` - ETHX=`/sbin/ifconfig | /bin/grep -i $MACX | /bin/awk '{print $1}'` + #ETHX=`/sbin/ifconfig | /bin/grep -i $MACX | /bin/awk '{print $1}'` + ETHX=`/sbin/ip -oneline link show ens33|/bin/grep -i $MACX |/bin/awk -F ":" '{print $2}'|/bin/grep -o "[^ ]\+\( \+[^ ]\+\)*"` break fi done diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index f3f8b2236..3c72f3dd0 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -81,7 +81,8 @@ for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do if ( pmatch $OSVER "ubuntu*" ) then NETWORK=`network_ipv4calc $IPADDR $NETMASK` - BROADCAST=`ifconfig $nic | grep Bcast | awk '{print $3}' | awk -F: '{print $2}'` + #BROADCAST=`ifconfig $nic | grep Bcast | awk '{print $3}' | awk -F: '{print $2}'` + BROADCAST=`ip -4 -oneline addr show $nic|grep brd| awk -F ' ' '{print $6}'` if [ ! -z "$defgw" ]; then gateway_line="gateway $defgw"