comparison scripts/build_project.sh @ 261:f51132ee0080 prerelease

build_project.sh sets the date. screen name changed to 'Bela'
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 16 May 2016 14:50:18 +0100
parents f2d47df23c68
children b491eb027f82
comparison
equal deleted inserted replaced
260:afdddd5f189f 261:f51132ee0080
8 BBB_PATH="~/BeagleRT" 8 BBB_PATH="~/BeagleRT"
9 RUN_PROJECT=1 9 RUN_PROJECT=1
10 COMMAND_ARGS= 10 COMMAND_ARGS=
11 RUN_IN_FOREGROUND=0 11 RUN_IN_FOREGROUND=0
12 RUN_WITHOUT_SCREEN=0 12 RUN_WITHOUT_SCREEN=0
13 SCREEN_NAME=Bela
13 14
14 function usage 15 function usage
15 { 16 {
16 THIS_SCRIPT=`basename "$0"` 17 THIS_SCRIPT=`basename "$0"`
17 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-nfF] <directory-with-source-files>" 18 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-nfF] <directory-with-source-files>"
75 usage 76 usage
76 exit 77 exit
77 fi 78 fi
78 79
79 # Stop BeagleRT and clean out old source files 80 # Stop BeagleRT and clean out old source files
80 echo "Stopping BeagleRT and removing old source files..." 81 echo "Stopping running program..."
81 ssh -t -t $BBB_ADDRESS "screen -X -S BeagleRT quit &>/dev/null; pkill BeagleRT ; make sourceclean -C $BBB_PATH" 82 # sets the date, stops the running process
83 ssh $BBB_ADDRESS "date -s '`date`' > /dev/null; screen -X -S '"$SCREEN_NAME"' quit &>/dev/null;"
82 84
83 #concatenate arguments to form path. 85 #concatenate arguments to form path.
84 BBB_SOURCE_PATH= #initially empty, will be filled with input arguments 86 BBB_SOURCE_PATH= #initially empty, will be filled with input arguments
85 for i in "$@" #parse input arguments 87 for i in "$@" #parse input arguments
86 do 88 do
115 if [ $RUN_WITHOUT_SCREEN -ne 0 ] 117 if [ $RUN_WITHOUT_SCREEN -ne 0 ]
116 then 118 then
117 ssh -t $BBB_ADDRESS "cd $BBB_PATH && make all && cd source && ../BeagleRT $COMMAND_ARGS" 119 ssh -t $BBB_ADDRESS "cd $BBB_PATH && make all && cd source && ../BeagleRT $COMMAND_ARGS"
118 elif [ $RUN_IN_FOREGROUND -eq 0 ] 120 elif [ $RUN_IN_FOREGROUND -eq 0 ]
119 then 121 then
120 ssh $BBB_ADDRESS "cd $BBB_PATH && make all && cd source && screen -S BeagleRT -d -m ../BeagleRT $COMMAND_ARGS" 122 ssh $BBB_ADDRESS "cd $BBB_PATH && make all && cd source && screen -S $SCREEN_NAME -d -m ../BeagleRT $COMMAND_ARGS"
121 else 123 else
122 ssh -t $BBB_ADDRESS "cd $BBB_PATH && make all && cd source && screen -S BeagleRT ../BeagleRT $COMMAND_ARGS" 124 ssh -t $BBB_ADDRESS "cd $BBB_PATH && make all && cd source && screen -S $SCREEN_NAME ../BeagleRT $COMMAND_ARGS"
123 fi 125 fi
124 fi 126 fi