From 81097f1b36e656c72fd4d2b3a6f42a12295d44a2 Mon Sep 17 00:00:00 2001 From: rawgni Date: Thu, 18 Aug 2016 22:30:32 +0700 Subject: [PATCH] fix setup.sh failing on macOSX --- CONTRIBUTORS.md | 1 + setup.sh | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c307c84537..e33ffd327c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -72,3 +72,4 @@ * net8q * SyncX * umbreon222 + * rawgni diff --git a/setup.sh b/setup.sh index 023ba4904a..f957eef447 100755 --- a/setup.sh +++ b/setup.sh @@ -43,15 +43,10 @@ Input location " location read -p "Input gmapkey " gmapkey -cp -f configs/config.json.example configs/config.json && chmod 755 configs/config.json -if [ "$auth" = "2" ] || [ "$auth" = "ptc" ] -then -sed -i "s/google/ptc/g" configs/config.json -fi -sed -i "s/YOUR_USERNAME/$username/g" configs/config.json -sed -i "s/YOUR_PASSWORD/$password/g" configs/config.json -sed -i "s/SOME_LOCATION/$location/g" configs/config.json -sed -i "s/GOOGLE_MAPS_API_KEY/$gmapkey/g" configs/config.json +[[ $auth = "2" || $auth = "ptc" ]] && auth="ptc" || auth="google" +sed -e "s/YOUR_USERNAME/$username/g" -e "s/YOUR_PASSWORD/$password/g" \ + -e "s/SOME_LOCATION/$location/g" -e "s/GOOGLE_MAPS_API_KEY/$gmapkey/g" \ + -e "s/google/$auth/g" configs/config.json.example > configs/config.json echo "Edit ./configs/config.json to modify any other config." }