From 711967ae9639095ce41500bb0e6f80c8b80fab95 Mon Sep 17 00:00:00 2001 From: Stuart Mackie Date: Tue, 25 Jul 2017 10:37:57 -0700 Subject: Contrail charms Change-Id: I2d259d03f63fce38348b8384e26ac23e3fce44a8 Signed-off-by: Stuart Mackie --- contrail-agent/scripts/vhost-phys.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 contrail-agent/scripts/vhost-phys.sh (limited to 'contrail-agent/scripts/vhost-phys.sh') diff --git a/contrail-agent/scripts/vhost-phys.sh b/contrail-agent/scripts/vhost-phys.sh new file mode 100755 index 0000000..7177eca --- /dev/null +++ b/contrail-agent/scripts/vhost-phys.sh @@ -0,0 +1,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 }' -- cgit 1.2.3-korg