#!/bin/sh

# See which name I was called...
ME=$(basename $0)

ifext=${ME#qemu-ifup-}

case $ifext in
  qemu-ifup)
    ifname=br0;;
  *)
    ifname=$ifext;;
esac
 
echo "Executing /etc/$ME"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to ${ifname}..."
sudo /usr/sbin/brctl addif $ifname $1
sleep 2
