Mercurial > hg > beaglert
comparison scripts/set_startup.sh @ 60:ad6b2767beaf newapi
Command-line argument support for BeagleRT program in scripts, plus a simple script for halting the BBB
author | andrewm |
---|---|
date | Wed, 15 Jul 2015 18:53:10 +0100 |
parents | 5bdf6efbd0ed |
children | a11e23f4e6af |
comparison
equal
deleted
inserted
replaced
59:5bdf6efbd0ed | 60:ad6b2767beaf |
---|---|
4 # up. | 4 # up. |
5 | 5 |
6 BBB_ADDRESS="root@192.168.7.2" | 6 BBB_ADDRESS="root@192.168.7.2" |
7 BBB_PATH="/root/BeagleRT" | 7 BBB_PATH="/root/BeagleRT" |
8 ENABLE_STARTUP=1 | 8 ENABLE_STARTUP=1 |
9 COMMAND_ARGS= | |
9 | 10 |
10 # This path is hard-coded in the BeagleRT image at present. | 11 # This path is hard-coded in the BeagleRT image at present. |
11 BBB_STARTUP_SCRIPT="/root/BeagleRT_startup.sh" | 12 BBB_STARTUP_SCRIPT="/root/BeagleRT_startup.sh" |
12 | 13 |
13 function usage | 14 function usage |
14 { | 15 { |
15 THIS_SCRIPT=`basename "$0"` | 16 THIS_SCRIPT=`basename "$0"` |
16 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-n]" | 17 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-n]" |
17 | 18 |
18 echo " | 19 echo " |
19 This script enables (by default) or disables running the BeagleRT | 20 This script enables (by default) or disables running the BeagleRT |
20 project at startup. The -n option disables auto-startup, otherwise | 21 project at startup. The -n option disables auto-startup, otherwise |
21 auto-startup is enabled. The -b option changes the default path, which | 22 auto-startup is enabled. The -b option changes the default path, which |
22 is otherwise $BBB_PATH." | 23 is otherwise $BBB_PATH. The -c option passes command-line arguments to |
24 the BeagleRT program; enclose the argument string in quotes." | |
23 } | 25 } |
24 | 26 |
25 OPTIND=1 | 27 OPTIND=1 |
26 | 28 |
27 while getopts "b:nh" opt; do | 29 while getopts "b:c:nh" opt; do |
28 case $opt in | 30 case $opt in |
29 b) BBB_PATH=$OPTARG | 31 b) BBB_PATH=$OPTARG |
32 ;; | |
33 c) COMMAND_ARGS=$OPTARG | |
30 ;; | 34 ;; |
31 n) ENABLE_STARTUP=0 | 35 n) ENABLE_STARTUP=0 |
32 ;; | 36 ;; |
33 h|\?) usage | 37 h|\?) usage |
34 exit 1 | 38 exit 1 |
53 ssh $BBB_ADDRESS "echo \"#!/bin/sh | 57 ssh $BBB_ADDRESS "echo \"#!/bin/sh |
54 # | 58 # |
55 # This file is autogenerated by BeagleRT. Do not edit! | 59 # This file is autogenerated by BeagleRT. Do not edit! |
56 | 60 |
57 echo Running BeagleRT... | 61 echo Running BeagleRT... |
58 screen -S BeagleRT -d -m $BBB_PATH/BeagleRT\" > $BBB_STARTUP_SCRIPT" | 62 screen -S BeagleRT -d -m $BBB_PATH/BeagleRT $COMMAND_ARGS\" > $BBB_STARTUP_SCRIPT" |
59 | 63 |
60 fi | 64 fi |