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 Index: scripts/setup.sh =================================================================== diff -u -rfe20dd714879e85a467516d379e210e5b9040205 -rb1c2f458dc6c49c923938f51a2a1a8f4ca130f2f --- scripts/setup.sh (.../setup.sh) (revision fe20dd714879e85a467516d379e210e5b9040205) +++ scripts/setup.sh (.../setup.sh) (revision b1c2f458dc6c49c923938f51a2a1a8f4ca130f2f) @@ -28,12 +28,12 @@ echo_dash_message "No SD-Card detected" echo_dash_message "UI Software logging will not work without a SD-Card" echo_dash_message "Insert a SD-Card and continue when ready" - echo_dash_comment + echo_dash_comment confirm "Continue" if [ $? -eq $FALSE ]; then exit $ERR_SD_CARD fi - else + else break fi done @@ -50,9 +50,9 @@ confirm "Do you want to format the SD-Card" if [ $? -eq $FALSE ]; then # give user an option to skip the format return $? - fi + fi fi - + while true; do echo "Unmount the SD-Card if is in use" umount "$SDCARD_PRT" @@ -70,7 +70,7 @@ break fi done - + echo "Removing current partitions" sfdisk --delete $SDCARD_DEV 1>/dev/null 2>/dev/null echo "Create new partition" @@ -91,7 +91,7 @@ echo "setup the time/date controller" # to use the system time/date and not use the network time protocol timedatectl set-ntp $TDCTL_NTP_USED - + echo "Setup the timezone (PDT Pacific)" timedatectl set-timezone $TDCTL_TIMEZONE timedatectl set-local-rtc $TDCTL_RTC_LOCL @@ -124,13 +124,13 @@ function setup_denali() { echo "Setting denali as default auto start application" - + chmod a+x $HOME/$INITD_AUTOSTART chmod a+x $HOME/$LAUNCH_SCR chmod a+x $HOME/$DENALI_BIN - + rm -f "$POSTLOG" "$POSTERR" "$POSTOUT" - + echo "Syncing file system updates" sync;sync;sync } @@ -155,12 +155,12 @@ function executionMode() { if [ "$(grep $SETUP_ENABLE_MANUFACTURING_MODE $SETUP_CONF_FILE)" = "" ]; then - # -U for Maunufacturing mode - # -a for disabling the non-minimizable Alarms + # -U for Updating mode + # -a for disabling the non-minimizable Alarms APPLICATION_PARAMS="-U -a" else - # -E for Updating mode - # -a for disabling the non-minimizable Alarms + # -E for Maunufacturing mode + # -a for disabling the non-minimizable Alarms APPLICATION_PARAMS="-E -a" fi enableDRT Index: scripts/start.sh =================================================================== diff -u -r2d38e1a292732115e5884919d3dd7ae7152fa0ad -rb1c2f458dc6c49c923938f51a2a1a8f4ca130f2f --- scripts/start.sh (.../start.sh) (revision 2d38e1a292732115e5884919d3dd7ae7152fa0ad) +++ scripts/start.sh (.../start.sh) (revision b1c2f458dc6c49c923938f51a2a1a8f4ca130f2f) @@ -92,7 +92,7 @@ } function sshRun() { - ssh $SSH_PARAM $DST_USER@$DST_IP $1:: + ssh $SSH_PARAM $DST_USER@$DST_IP $1 return $? } @@ -159,7 +159,7 @@ sshRun "echo $SETUP_ENABLE_MANUFACTURING_MODE > $SETUP_CONF_FILE" echo_star_message "Set the setup in manufacturing mode" else - sshRun "echo '' > $SETUP_CONF_FILE" + sshRun "echo '' > $SETUP_CONF_FILE" echo_star_message "Continuing the setup in normal mode" fi } @@ -237,7 +237,7 @@ } function setupDemoMode() { - if [ $DEMO_SETUP != 0 ]; then return fi + if [ "$DEMO_SETUP" != "1" ]; then return; fi echo_dash_comment echo_dash_message "Installing Dry-Demo" | tee -a $LOG_OUT_FILE echo_dash_comment @@ -265,18 +265,18 @@ function main() { displayHelp "$1" - + defaultIP "$1" getDeviceIP setupLogs - + sshKeyGen sshKeyCopy - + killPrompt manufacturingModePrompt wipe_device - + setupBootupScripts setupSettingsScripts setupConfigurations