From: Munkyu Im Date: Thu, 24 Sep 2015 08:47:25 +0000 (+0900) Subject: net: bridge name is flexible X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~40^2~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e27e83237a8b1568342a2a2775c9314384e953ff;p=sdk%2Femulator%2Fqemu.git net: bridge name is flexible qemu set bridged network on mac os 10.8. bridge name was fixed with "bridge0". However from mac os 10.9, the setting is possible on host network configuration. So, support another bridge names. Change-Id: I6c75766ca624847cf5e11a5ff9f61afbe89f041f Signed-off-by: Munkyu Im --- diff --git a/tizen/src/scripts/emulator-ifup-darwin.sh b/tizen/src/scripts/emulator-ifup-darwin.sh index d199e71f18..c4a2bd6f53 100755 --- a/tizen/src/scripts/emulator-ifup-darwin.sh +++ b/tizen/src/scripts/emulator-ifup-darwin.sh @@ -1,18 +1,29 @@ #!/bin/sh -x -BRIDGE=bridge1 +#$1 = tap name (e.g. tap0) +#$2 = bridge name (optional) TAP=$1 -BASE=en0 echo "TAP: $1" + +BRIDGE="" +if [ x"$2" != x ]; then + echo "BRIDGE=$2" + BRIDGE=$2 +else + echo "BRIDGE=bridge1" + BRIDGE=bridge1 +fi + +BASE=en0 echo "get base network information" IP=`ipconfig getifaddr $BASE` NETMASK=`ifconfig $BASE | grep "inet " | awk '{print $4}'` -GW=`netstat -rn | grep ^default | awk '{print $2}'` +GW=`netstat -rn | grep $BRIDGE | grep ^default | awk '{print $2}'` echo "IP: $IP" echo "NETMASK: $NETMASK" echo "GW: $GW" echo "create bridge interface" -CHECK_BR=`ifconfig | grep ^bridge1:` +CHECK_BR=`ifconfig | grep ^$BRIDGE:` echo "CHECK_BR: $CHECK_BR" if [ "$CHECK_BR" = "" ] then