# $1: tap name
# $2: interface name could be eth0 or bridge name
-if [ "$2" == "" ];then
+if [ "x$2" = "x" ];then
NETMASK=""
else
NETMASK=`ifconfig $2 | grep "inet " | awk '{print $4}' | cut -d : -f2`
echo "Check if bridge interface exists."
echo "CHECK_BR=`/bin/ls /sys/class/net | grep $BR`"
CHECK_BR=`/bin/ls /sys/class/net | grep $BR`
-if [ "$CHECK_BR" = "" ]
+if [ "x$CHECK_BR" = "x" ]
then
echo "$BR does not exist! create it"
BASEIPADDR=`ip addr show eth0 | awk '/inet / {print $2}' | cut -d/ -f1`
brctl addif $BR $1
echo "Add the default route."
-if [ "$NETMASK" == "" ];then
+if [ "x$NETMASK" = "x" ];then
echo "netmask is NULL"
- echo ifconfig $BR $BASEIPADDR
+ echo "ifconfig $BR $BASEIPADDR"
ifconfig $BR $BASEIPADDR
else
- echo ifconfig $BR $BASEIPADDR netmask $NETMASK
+ echo "ifconfig $BR $BASEIPADDR netmask $NETMASK"
ifconfig $BR $BASEIPADDR netmask $NETMASK
fi
NET=`netstat -rn | grep ^0.0.0.0 | awk '{print $8}'`