From 7fcce4fd26ff983dfd7aa9a28b6ba45841609163 Mon Sep 17 00:00:00 2001 From: seefo Date: Tue, 5 Jun 2018 06:53:20 -0400 Subject: [PATCH] Added config support for build script --- .gitignore | 1 + build.sh | 43 +++++++++++++++++++++++++------------------ config.sh.example | 8 ++++++++ 3 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 config.sh.example diff --git a/.gitignore b/.gitignore index 1ccd82e..c1a2752 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,6 @@ dsrc/* site/* stationapi/build/* .setup +config.sh checksums_*.txt patch_*.rsp diff --git a/build.sh b/build.sh index 06f064e..83afa78 100755 --- a/build.sh +++ b/build.sh @@ -2,14 +2,6 @@ basedir=$PWD PATH=$PATH:$basedir/build/bin -DBSERVICE= -DBUSERNAME= -DBPASSWORD= -HOSTIP= -CLUSTERNAME= -NODEID= -DSRC_DIR= -DATA_DIR= GIT_URL="https://bitbucket.org/seefoe/" GIT_REPO_SRC=${GIT_URL}src.git GIT_REPO_DSRC=${GIT_URL}dsrc.git @@ -18,6 +10,11 @@ GIT_REPO_DATA=${GIT_URL}data.git GIT_REPO_CLIENTDATA=${GIT_URL}clientdata.git GIT_REPO_SITE=${GIT_URL}swg-site.git +# load config for build script +if [ -e "config.sh" ]; then + source config.sh +else + # Debug and Release are for testing and not public servers, they lack optimizations MODE=Release #MODE=Debug @@ -120,20 +117,30 @@ read -p "Do you want to build the config environment now? (y/n) " response response=${response,,} # tolower if [[ $response =~ ^(yes|y| ) ]]; then - echo "Enter your IP address (LAN for port forwarding or internal, outside IP for DMZ)" - read HOSTIP + if [[ -z "$HOSTIP" ]]; then + echo "Enter your IP address (LAN for port forwarding or internal, outside IP for DMZ)" + read HOSTIP + fi - echo "Enter the DSN for the database connection " - read DBSERVICE + if [[ -z "$DBSERVICE" ]]; then + echo "Enter the DSN for the database connection " + read DBSERVICE + fi - echo "Enter the database username " - read DBUSERNAME + if [[ -z "$DBUSERNAME" ]]; then + echo "Enter the database username " + read DBUSERNAME + fi - echo "Enter the database password " - read DBPASSWORD + if [[ -z "$DBPASSWORD" ]]; then + echo "Enter the database password " + read DBPASSWORD + fi - echo "Enter a name for the galaxy cluster " - read CLUSTERNAME + if [[ -z "$CLUSTERNAME" ]]; then + echo "Enter a name for the galaxy cluster " + read CLUSTERNAME + fi if [ -d $basedir/exe ]; then rm -rf $basedir/exe diff --git a/config.sh.example b/config.sh.example new file mode 100644 index 0000000..f50d82c --- /dev/null +++ b/config.sh.example @@ -0,0 +1,8 @@ +DBSERVICE= +DBUSERNAME= +DBPASSWORD= +HOSTIP= +CLUSTERNAME= +NODEID= +DSRC_DIR= +DATA_DIR= \ No newline at end of file