-####################
-# xxx tmp for a demo
-# there *must* be a better way to do that
-# the thing is the slice sees several tap devices at this point, which is odd...
-# for now I'm searching the tapname based on some hint - the vnet ip range
-VNET=10.0.16
-function show_mac () {
- ifnames=$(grep : /proc/net/dev | cut -d: -f1 | awk '{print $1;}')
- tapname=""
- for ifname in $ifnames; do
- ifconfig $ifname | grep -q "$VNET" && tapname=$ifname
- done
- if [ -z "$tapname" ] ; then
- echo "no-tap-found-for$VNET"
- exit 1
- fi
- ifconfig $tapname | grep -i hwaddr | awk '{print $5;}'
-}
-