aboutsummaryrefslogtreecommitdiffstats
path: root/contrail-agent/scripts/vhost-phys.sh
blob: 7177eca53bba5235fc383352a5d2bac577723a23 (plain)
1
2
3
4
5
6
7
#!/bin/sh -e
#
# Script used to determine physical interface of vhost0

iface="$1"
mac=$(cat /sys/class/net/$iface/address)
vif --list | awk -v mac=$mac -v iface=$iface 'BEGIN { RS="\n\n" }; $3 != iface && $0 ~ "HWaddr:" mac { print $3; exit 0 }'