prerun: enhanced code readability 08/52408/2
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 30 Jun 2015 05:10:52 +0000 (14:10 +0900)
committerSooyoung Ha <yoosah.ha@samsung.com>
Mon, 23 Nov 2015 12:02:41 +0000 (21:02 +0900)
Change-Id: Ia2910089eac42c2c609eb330ecaada3cff9caebe
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
(cherry picked from commit 082137463a0e9ab58ba36bfecd9d80a4b34b9a5e)

filesystem/etc/emulator/prerun.d/generate-emulator-env.sh

index c26f3e7129a1cb9242d4b6a89dfcd0d621adebfe..d72ee6b921f1cd0baa421d76c3b1ce07caf2c001 100644 (file)
@@ -30,15 +30,16 @@ do
     eval PROXY="\$PROXIES$index"
     eval URL="\$URLS$index"
     if [ ! -z ${PROXY} ] ; then
-        __PROXY=`sed "s/^.*${PROXY}=\([^, ]*\).*$/\1/g" $CMDLINE`
-        if [ "x${__PROXY}" = "x" ] || ! grep -q ${PROXY} $CMDLINE ; then
-            echo "export ${PROXY}=" >> $EMULATOR_ENV
-            echo -e "- ${PROXY}="
-        else
-            echo "export ${PROXY}=${URL}://${__PROXY}/" >> $EMULATOR_ENV
-            echo -e "- ${PROXY}=${URL}://${__PROXY}/"
+        EXPORT_CONTENT="${PROXY}="
+        if grep -q ${PROXY} $CMDLINE ; then
+            __PROXY=`sed "s/^.*${PROXY}=\([^, ]*\).*$/\1/g" $CMDLINE`
+            if [ "x${__PROXY}" != "x" ] ; then
+                EXPORT_CONTENT="${EXPORT_CONTENT}${URL}://${__PROXY}/" >> $EMULATOR_ENV
+            fi
         fi
+        echo "export ${EXPORT_CONTENT}" >> $EMULATOR_ENV
+        echo -e "- ${EXPORT_CONTENT}"
     fi
 done
-echo "export no_proxy=localhost,127.0.0.1/8,10.0.0.0/1" >> $EMULATOR_ENV
-echo -e "- no_proxy=localhost,127.0.0.1/8,10.0.0.0/1"
+echo "export no_proxy=localhost,127.0.0.1/8,10.0.2.0/24" >> $EMULATOR_ENV
+echo -e "- no_proxy=localhost,127.0.0.1/8,10.0.2.0/24"