#!/bin/bash
#
#   ConVirt   -  Copyright (c) 2008 Convirture Corp.
#   ======
#
# ConVirt is a Virtualization management tool with a graphical user
# interface that allows for performing the standard set of VM operations
# (start, stop, pause, kill, shutdown, reboot, snapshot, etc...). It
# also attempts to simplify various aspects of VM lifecycle management.
#
#
# This software is subject to the GNU General Public License, Version 2 (GPLv2)
# and for details, please consult it at:
#
#    http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
# 
#
# author : mkelkar@users.sourceforge.net
#
switch=SWITCH_NAME

if [ -n "$1" ];then
        tunctl -u `whoami` -t $1
        ip link set $1 up
        sleep 0.5s
        brctl addif ${switch} $1
        exit 0
else
        echo "Error: no interface specified"
        exit 1
fi
