Index: scripts/start.sh =================================================================== diff -u -rfa220019a309871996ad169368b32179a4a7f4a7 -r8eed6fb0d0681747d4dbf161928e8cda56904f5f --- scripts/start.sh (.../start.sh) (revision fa220019a309871996ad169368b32179a4a7f4a7) +++ scripts/start.sh (.../start.sh) (revision 8eed6fb0d0681747d4dbf161928e8cda56904f5f) @@ -79,35 +79,33 @@ # if it is the update only we don't need the configuration if (( $MANUFACTURING_SETUP )); then echo "Device setup Mode : Manufacturing Setup" + + getServerIP + echo "DRT Server IP Address : $SERVER_IP" + + getServerWS + echo "DRT Server Environment: $SERVER_WS" + + # setting up the DRT Server IP address + #If the server IP is not given or is invalid will be asked to enter and the defualt Diality prefered will be suggested. + #If the server IP is valid and accepted then change the CloudSync conf file + sed -i "s/$SERVER_CONFIG_LINE/$SERVER_CONFIG_BGN$SERVER_IP$SERVER_CONFIG_END/" $config_json + #and modify the globals.sh + sed -i "s/$GLOBALS_CONFIG_LINE/$GLOBALS_CONFIG_MDFY$SERVER_IP/" $GLOBALS_FILE else echo "Device setup Mode : Update Only" - return + SERVER_WS=$SERVER_DRT_WS_PRODUCT fi - - getServerIP - echo "DRT Server IP Address : $SERVER_IP" - - getServerWS - echo "DRT Server Environment: $SERVER_WS" - + # create the conf file - local config_env_json="$SERVER_CONFIG_FILE" - local config_json="$SERVER_CONFIG_FILE" - - - # creat the config.json file - cp "$SERVER_CONFIG_JSON_WS""_""$SERVER_WS"".""$SERVER_CONFIG_EXT" $SERVER_CONFIG_JSON # copy the config for the selected environment to config.json - if [[ ! -e $SERVER_CONFIG_JSON ]]; then - echo "The file $SERVER_CONFIG_JSON cannot be created" + local config_env_json="$SERVER_CONFIG_JSON_WS""_""$SERVER_WS"".""$SERVER_CONFIG_EXT" + local config_json="$SERVER_CONFIG_JSON" + echo "CloudSync config : "$config_env_json + cp $config_env_json $config_json # copy the config for the selected environment to config.json + if [[ ! -e $config_json ]]; then + echo "The file $config_json cannot be created" exit 0 fi - - # setting up the DRT Server IP address - #If the server IP is not given or is invalid will be asked to enter and the defualt Diality prefered will be suggested. - #If the server IP is valid and accepted then change the CloudSync conf file - sed -i "s/$SERVER_CONFIG_LINE/$SERVER_CONFIG_BGN$SERVER_IP$SERVER_CONFIG_END/" $SERVER_CONFIG_JSON - #and modify the globals.sh - sed -i "s/$GLOBALS_CONFIG_LINE/$GLOBALS_CONFIG_MDFY$SERVER_IP/" $GLOBALS_FILE } function displayHelp() { @@ -291,7 +289,6 @@ function validWS() { if [[ -z $SERVER_WS ]]; then return 1; fi - case $SERVER_WS in "$SERVER_DRT_WS_PRODUCT");; "$SERVER_DRT_WS_STAGING");; @@ -300,7 +297,6 @@ echo "The entered server environment is not valid [$SERVER_WS]" return 1 esac - return 0 }