giuliomoro@457: #!/bin/sh giuliomoro@457: # giuliomoro@457: giuliomoro@457: # set defaults unless variables are already set giuliomoro@457: giuliomoro@462: SCRIPTDIR=$(dirname "$0") giuliomoro@462: [ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ giuliomoro@462: . $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } giuliomoro@457: giuliomoro@457: usage() giuliomoro@457: { giuliomoro@457: THIS_SCRIPT=`basename "$0"` giuliomoro@457: echo "Usage: $THIS_SCRIPT [start] [stop] [startup] [nostartup] " giuliomoro@457: echo "This program controls Bela's IDE. giuliomoro@457: ./$THIS_SCRIPT start -- starts or restarts the IDE giuliomoro@457: ./$THIS_SCRIPT stop -- stops the IDE giuliomoro@457: ./$THIS_SCRIPT startup -- sets the IDE to start at boot giuliomoro@457: ./$THIS_SCRIPT nostartup -- disables the IDE at boot giuliomoro@457: " giuliomoro@457: } giuliomoro@457: giuliomoro@457: MAKE_COMMAND="make --no-print-directory -C $BBB_BELA_HOME" giuliomoro@457: while [ -n $1 ] giuliomoro@457: do giuliomoro@457: case $1 in giuliomoro@457: start) giuliomoro@457: ssh $BBB_ADDRESS $MAKE_COMMAND idestart giuliomoro@457: exit $? giuliomoro@457: ;; giuliomoro@457: stop) giuliomoro@457: ssh $BBB_ADDRESS $MAKE_COMMAND idestop giuliomoro@457: exit $? giuliomoro@457: ;; giuliomoro@457: startup) giuliomoro@457: ssh $BBB_ADDRESS $MAKE_COMMAND idestartup giuliomoro@457: exit $? giuliomoro@457: ;; giuliomoro@457: nostartup) giuliomoro@457: ssh $BBB_ADDRESS $MAKE_COMMAND idenostartup giuliomoro@457: exit $? giuliomoro@457: ;; giuliomoro@457: *) giuliomoro@457: usage giuliomoro@457: exit 1 giuliomoro@457: ;; giuliomoro@457: esac giuliomoro@457: shift giuliomoro@457: done