Mercurial > hg > beaglert
diff scripts/update_board.sh @ 428:b27676f871d7 prerelease
Some more sh compatiblity things: no &>, no 'function'
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Thu, 16 Jun 2016 19:20:22 +0100 |
parents | fd948111f8ea |
children | 8533f7198644 |
line wrap: on
line diff
--- a/scripts/update_board.sh Thu Jun 16 18:09:59 2016 +0100 +++ b/scripts/update_board.sh Thu Jun 16 19:20:22 2016 +0100 @@ -15,7 +15,7 @@ BELA_IDE_SCREEN_NAME=IDE-Bela SCREEN_NAME=Bela -function usage +usage () { THIS_SCRIPT=`basename "$0"` echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [--clean] [-y]" @@ -36,9 +36,16 @@ -y : does not prompt the user before deleting the remote files. " } -trap "echo; exit" SIGINT SIGTERM -function error_handler { +signal_handler () +{ + echo + exit +} + +trap signal_handler SIGINT SIGTERM + +error_handler () { [ $1 -eq 0 ] && printf "done\n" || { [ -z "$2" ] && printf "\nAn error occurred. Is the board connected?\n" || printf "$2"; exit 1; } } @@ -140,15 +147,15 @@ error_handler $? printf "Generating on-board documentation..." -ssh $BBB_ADDRESS "cd $BBB_BELA_HOME; doxygen &>/dev/null" +#ssh $BBB_ADDRESS "cd $BBB_BELA_HOME; doxygen &> /dev/null" error_handler $? "\nError while generating Doxygen documentation\n" #------------- #Installing IDE -ls $IDE_FOLDER/scripts/setup_IDE.sh &> /dev/null +ls $IDE_FOLDER/scripts/setup_IDE.sh >/dev/null 2>/dev/null if [ $? -eq 0 ] then - cd $IDE_FOLDER/scripts && ./setup_IDE.sh -y + cd $IDE_FOLDER/scripts && ./setup_IDE.sh - # run the IDE ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" else @@ -156,7 +163,8 @@ ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" echo \ "The Bela core files were updated the board, but a valid IDE folder was not found in $IDE_FOLDER/, so the IDE was not updated. If there was an older version of the IDE on the board, it is being restarted. -You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide" +You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide +" fi ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && echo "The board will now run the IDE at startup, but startup of the Bela program has been disabled. To enable it, use the set_startup.sh script"