changeset 515:03b511d99f3d prerelease

bela_common was left out of the previous commit
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 22 Jun 2016 13:22:31 +0100
parents ce5bb14c21fb
children 7eb66c7898cb
files scripts/.bela_common
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/.bela_common	Wed Jun 22 12:40:28 2016 +0100
+++ b/scripts/.bela_common	Wed Jun 22 13:22:31 2016 +0100
@@ -30,3 +30,11 @@
 # an optional parameter will be executed as part of the same ssh session
 	ssh $BBB_ADDRESS "date -s \"`date '+%Y%m%d %T %Z'`\" > /dev/null; $1"
 }
+
+check_board_alive(){
+	printf "Checking the board is up and running at $BBB_ADDRESS..."
+	ssh -o ConnectTimeout=10 $BBB_ADDRESS exit && printf "done\n" || {
+		printf "\nERROR: the board does not respond at $BBB_ADDRESS, check that the address is correct and the board is connected.\n";
+		exit 1;
+	}
+}