replace ifconfig with ip
This commit is contained in:
parent
66d5ac4091
commit
b75e2139a8
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user