mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2804 getEthByIp function in vpc_func.sh can return the wrong
network interface
This commit is contained in:
parent
54127f838e
commit
5c9828db7d
|
|
@ -22,7 +22,7 @@ getEthByIp (){
|
|||
local ip=$1
|
||||
for dev in `ls -1 /sys/class/net | grep eth`
|
||||
do
|
||||
sudo ip addr show dev $dev | grep $ip > /dev/null
|
||||
sudo ip addr show dev $dev | grep $ip\/ > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo $dev
|
||||
|
|
|
|||
Loading…
Reference in New Issue