From cdfbd498e5517f85872a9dc852d4a15878201ab2 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Tue, 30 Jun 2015 14:10:52 +0900 Subject: [PATCH] prerun: enhanced code readability Change-Id: Ia2910089eac42c2c609eb330ecaada3cff9caebe Signed-off-by: SeokYeon Hwang Signed-off-by: Munkyu Im (cherry picked from commit 082137463a0e9ab58ba36bfecd9d80a4b34b9a5e) --- .../prerun.d/generate-emulator-env.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/filesystem/etc/emulator/prerun.d/generate-emulator-env.sh b/filesystem/etc/emulator/prerun.d/generate-emulator-env.sh index c26f3e7..d72ee6b 100644 --- a/filesystem/etc/emulator/prerun.d/generate-emulator-env.sh +++ b/filesystem/etc/emulator/prerun.d/generate-emulator-env.sh @@ -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" -- 2.34.1