comparison scripts/update_board @ 517:4656f886175e prerelease

reverted to bash, better handling of non existing IDE folder during update_board
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 22 Jun 2016 15:21:58 +0100
parents ce5bb14c21fb
children 1c68ad13bbe4
comparison
equal deleted inserted replaced
516:7eb66c7898cb 517:4656f886175e
1 #!/bin/sh 1 #!/bin/bash
2 # 2 #
3 # This script copies the core Bela files to the BeagleBone Black 3 # This script copies the core Bela files to the BeagleBone Black
4 # in preparation for building projects. It will remove any existing 4 # in preparation for building projects. It will remove any existing
5 # Bela directory before copying the files over 5 # Bela directory before copying the files over
6 6
98 98
99 99
100 check_board_alive 100 check_board_alive
101 # Check if destination folder exists 101 # Check if destination folder exists
102 # the StrictHostKeyChecking no should prevent the unkown host prompt 102 # the StrictHostKeyChecking no should prevent the unkown host prompt
103 ssh -o "StrictHostKeyChecking no" $BBB_ADDRESS stat $BBB_BELA_HOME &>/dev/null && DESTINATION_EMPTY=0 || DESTINATION_EMPTY=1 103 ssh -o "StrictHostKeyChecking no" $BBB_ADDRESS [ -d $BBB_BELA_HOME ] && DESTINATION_EMPTY=0 || DESTINATION_EMPTY=1
104 # Set the date on the board 104 # Set the date on the board
105 [ $FULL -eq 1 ] && set_date 105 [ $FULL -eq 1 ] && set_date
106 106
107 if [ $DESTINATION_EMPTY -eq 0 ]; 107 if [ $DESTINATION_EMPTY -eq 0 ];
108 then 108 then
199 else 199 else
200 # run the IDE 200 # run the IDE
201 printf "\nThe Bela core files were updated on the board, but a valid IDE folder was not found in $IDE_FOLDER/, so the IDE was not updated. 201 printf "\nThe Bela core files were updated on the board, but a valid IDE folder was not found in $IDE_FOLDER/, so the IDE was not updated.
202 You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide\n" 202 You can get a copy of the most up-to-date IDE files from https://github.com/LBDonovan/bela-ide\n"
203 [ $FULL -eq 1 ] && printf "If there was an older version of the IDE on the board, it is being restarted.\n\n" &&\ 203 [ $FULL -eq 1 ] && printf "If there was an older version of the IDE on the board, it is being restarted.\n\n" &&\
204 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart" 204 ssh $BBB_ADDRESS "make -C $BBB_BELA_HOME --no-print-directory idestart &> /dev/null"
205 fi 205 fi
206 else 206 else
207 echo "Not updating the IDE" 207 echo "Not updating the IDE"
208 fi 208 fi
209 [ $FULL -eq 1 ] && ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && printf "The board will now run the IDE at startup, but startup of the Bela program has been disabled.\nTo enable it, use the set_startup.sh script.\nTo control the ide use the ide.sh script\n" 209 [ $FULL -eq 1 ] && ssh $BBB_ADDRESS make -C $BBB_BELA_HOME --no-print-directory idestartup nostartup && printf "The board will now run the IDE at startup, but startup of the Bela program has been disabled.\nTo enable it, use the set_startup.sh script.\nTo control the ide use the ide.sh script\n"