Index: scripts/start.sh =================================================================== diff -u -r9292d4e761297501dac5166de69c7d16c03bfb0a -r763077dce249b1c3713611429ff0e26e27c4dff3 --- scripts/start.sh (.../start.sh) (revision 9292d4e761297501dac5166de69c7d16c03bfb0a) +++ scripts/start.sh (.../start.sh) (revision 763077dce249b1c3713611429ff0e26e27c4dff3) @@ -23,7 +23,7 @@ DEMO_SETUP=0 DEMO_SWITCH="-D" -SERVER_IP="" +SERVER_IP=$CloudSync_DRT_SERVER_IP SERVER_PORT="3000" SERVER_SWITCH="-S" SERVER_CONFIG_LINE=".*\"url_mft\".*" @@ -37,24 +37,30 @@ # command line parameters detection -for arg in "$@"; do - case $arg in - "$DEMO_SWITCH") - DEMO_SETUP=1 - echo "Setup started for demo mode" - ;; - "$SERVER_SWITCH"*) - SERVER_IP="${arg:2}" - getServerIP - #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 "s/$SERVER_CONFIG_LINE/$SERVER_CONFIG_BGN$SERVER_IP$SERVER_CONFIG_END/" $SERVER_CONFIG_FILE - #and modify the globals.sh - sed "s/$GLOBALS_CONFIG_LINE/$GLOBALS_CONFIG_MDFY$SERVER_IP/" $GLOBALS_FILE - echo "DRT Server IP: $SERVER_IP" - ;; - esac -done +function setupParameters() { + for arg in "$@"; do + case $arg in + "$DEMO_SWITCH") + DEMO_SETUP=1 + echo "Setup started for demo mode" + ;; + "$SERVER_SWITCH"*) + SERVER_IP="${arg:2}" + getServerIP + if [[ $SERVER_IP == $CloudSync_DRT_SERVER_IP ]]; then + # same as default and no need to update. + return + fi + #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_FILE + #and modify the globals.sh + sed -i "s/$GLOBALS_CONFIG_LINE/$GLOBALS_CONFIG_MDFY$SERVER_IP/" $GLOBALS_FILE + echo "DRT Server IP: $SERVER_IP" + ;; + esac + done +} function displayHelp() { if [ "$1" = "-h" -o "$1" = "--help" ]; then @@ -341,6 +347,7 @@ } # running the main function +setupParameters "$@" main "$1" connect