net: modify script file for setting bridge network
authorMunkyu Im <munkyu.im@samsung.com>
Thu, 8 Oct 2015 06:25:13 +0000 (15:25 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Tue, 20 Oct 2015 04:06:39 +0000 (13:06 +0900)
 - fix if statement
 - modify log

Change-Id: Ie9841bf824680fa0106c596f102a2d3a9170381d
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/scripts/emulator-ifup-linux.sh

index e111dcffad973c55802efae9b9b1359eedab4958..13a057d9cc896f87215ba128e857cf6b0d4ba4a5 100755 (executable)
@@ -3,7 +3,7 @@
 # $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`
@@ -15,7 +15,7 @@ echo "GW: $GW"
 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`
@@ -38,12 +38,12 @@ fi
 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}'`