Index: scripts/globals.sh =================================================================== diff -u -r2d38e1a292732115e5884919d3dd7ae7152fa0ad -rb1c2f458dc6c49c923938f51a2a1a8f4ca130f2f --- scripts/globals.sh (.../globals.sh) (revision 2d38e1a292732115e5884919d3dd7ae7152fa0ad) +++ scripts/globals.sh (.../globals.sh) (revision b1c2f458dc6c49c923938f51a2a1a8f4ca130f2f) @@ -69,7 +69,7 @@ DST_PATH_HOME="/home/$DST_USER" DST_PATH_SCRIPTS="/home/$DST_USER/scripts" DST_PATH_CLOUDSYNC="/home/$DST_USER/cloudsync" -DST_PATH_CLOUDSYNC="/home/$DST_USER/dry-demo" +DST_PATH_DRYDEMO="/home/$DST_USER/dry-demo" DST_PATH_FONTS="/usr/share/fonts/truetype" POSTLOG=/tmp/post.log @@ -122,7 +122,7 @@ DEMO_USER=root DEMO_HOME=/home/$DEMO_USER -SETTING_CONF_FOLDER_PATH=/var/configurations +SETTING_CONF_FOLDER_PATH=/var/configurations SETTINGS_CRC_FILE_PATH=$DENALI_HOME/settings.crc DEMO_MODE=0 @@ -138,10 +138,10 @@ # *** this function should be used without brackets in the if to be effective. function isDemoMode() { - if [ "$DEMO_MODE" == "1" ]; then - return 0 # exit/return 0 for if in bash is true + if [ $DEMO_MODE -eq 1 ]; then + return TRUE # exit/return 0 for if in bash is true else - return 1 # exit/return not 0 for if in bash is false + return FALSE # exit/return not 0 for if in bash is false fi } @@ -152,7 +152,7 @@ return $TRUE else echo "" - return $FALSE + return $FALSE fi } @@ -270,7 +270,7 @@ function post_out () { echo "$1" >> $POSTOUT; } function post_out_dash () { echo "$COMMENT_DASH$1" >> $POSTOUT; } -function debug () { +function debug () { echo_dash_comment echo_dash_message "$1" echo_dash_comment @@ -314,7 +314,7 @@ post_log_dash " Ethernet " ieth=eth0 udhcpc --timeout=5 --retries=2 -n -i $ieth - post_log "$(ip addr show $ieth)" # -details -statistics + post_log "$(ip addr show $ieth)" # -details -statistics } function setupPCAN() { @@ -343,8 +343,7 @@ } function setupCANBus() { - # *** eliminated brackets are intentional. *** - if $(isDemoMode); then + if [ $(isDemoMode) -eq TRUE ]; then D_CANBUS=$V_CANBUS setupVCAN else @@ -590,8 +589,7 @@ DENALI_VERSION="$($DENALI_HOME/$DENALI_BIN -v)" if [ -n "$DENALI_VERSION" ]; then post_log_pass "$DENALI_VERSION" # log UI Software version - # *** eliminated brackets are intentional. *** - if $(isDemoMode); then + if [ $(isDemoMode) -eq TRUE ]; then APPLICATION_PARAMS="$APPLICATION_PARAMS"" -q -D -A $D_CANBUS" fi sudo -u $DENALI_USER $DENALI_HOME/$DENALI_BIN $APPLICATION_PARAMS 1>> /tmp/denali.out 2>> /tmp/denali.out & @@ -602,7 +600,7 @@ function startDemoMode_local() { # *** eliminated brackets are intentional. *** - if $(isDemoMode); then + if [ $(isDemoMode) -eq TRUE ]; then # ----------------------------------------- Demo Mode post_log_dash " Demo Mode " local DRYDEMO_PATH=$DEMO_HOME/$DEMO_FOLDER @@ -628,7 +626,7 @@ function applicationPOST() { setupConsoleout disableRootSSH - cleanupPOSTLogs + cleanupPOSTLogs checkDemoMode queryOSVersion setupCANBus