Blame tests/p_bridge-utils/05-add_bridge.sh

root 06ef83
#!/bin/bash
root 06ef83
# Author : Madhurranjan Mohaan <madhurranjan.mohaan@gmail.com>
root 06ef83
root 06ef83
if  [ $# -eq 0 ]
root 06ef83
then
root 06ef83
  bridge=testbridge1
root 06ef83
else
root 06ef83
  bridge=$1
root 06ef83
fi
root 06ef83
root 06ef83
t_Log "Running $0 - Adding a dummy Bridge: $bridge"
root 06ef83
bridge_present=`brctl show | grep $bridge`
root 06ef83
if ! [ "$bridge_present" ]
root 06ef83
  then
root 06ef83
  brctl addbr $bridge 
root 06ef83
  bridge_present=`brctl show | grep $bridge`
root 06ef83
  if [ "$bridge_present" ]
root 06ef83
  then
root 06ef83
    ret_val=0  
root 06ef83
  else
root 06ef83
    ret_val=1
root 06ef83
  fi
root 06ef83
else 
root 06ef83
  ret_val=0
root 06ef83
fi
root 06ef83
root 06ef83
t_CheckExitStatus $ret_val