annotate scripts/run_project.sh @ 58:3ffafa57302c newapi

Added scripts for building on board
author andrewm
date Wed, 15 Jul 2015 15:49:00 +0100
parents
children ad6b2767beaf
rev   line source
andrewm@58 1 #!/bin/bash
andrewm@58 2 #
andrewm@58 3 # This script runs an already-compiled BeagleRT project on the
andrewm@58 4 # BeagleBone Black.
andrewm@58 5
andrewm@58 6 BBB_ADDRESS="root@192.168.7.2"
andrewm@58 7 BBB_PATH="~/BeagleRT"
andrewm@58 8
andrewm@58 9 function usage
andrewm@58 10 {
andrewm@58 11 THIS_SCRIPT=`basename "$0"`
andrewm@58 12 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone]"
andrewm@58 13
andrewm@58 14 echo "
andrewm@58 15 This script runs a previously compiled BeagleRT project on the
andrewm@58 16 BeagleBone Black. The -b option changes the default path, which
andrewm@58 17 is otherwise $BBB_PATH."
andrewm@58 18 }
andrewm@58 19
andrewm@58 20 OPTIND=1
andrewm@58 21
andrewm@58 22 while getopts "b:h" opt; do
andrewm@58 23 case $opt in
andrewm@58 24 b) BBB_PATH=$OPTARG
andrewm@58 25 ;;
andrewm@58 26 h|\?) usage
andrewm@58 27 exit 1
andrewm@58 28 esac
andrewm@58 29 done
andrewm@58 30
andrewm@58 31 shift $((OPTIND-1))
andrewm@58 32
andrewm@58 33 echo "Running BeagleRT..."
andrewm@58 34 ssh $BBB_ADDRESS "kill -s 2 \`pidof BeagleRT\` 2>/dev/null ; sleep 0.5 ; screen -d -m $BBB_PATH/BeagleRT"