-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrunbp
More file actions
executable file
·25 lines (21 loc) · 948 Bytes
/
runbp
File metadata and controls
executable file
·25 lines (21 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/ksh
# Runs a command remotely on the BrickPi, assuming default credentials and device name.
# Copies whole BrickPython directory structure to the same location on the raspberrypi
# E.g.
# cd ExamplePrograms; ../runbp python SimpleApp.py
# This script lives in the BrickPython project directory
# To make it executable:
# chmod a+x runpb
# To make ssh work without entering passwords, see
# https://www.debian.org/devel/passwordlessssh
# Note - The windows will appear on the BrickPi's screen, not locally to this machine.
# Current working directory relative to home:
WorkingRelDir=${PWD#$HOME/}
# BrickPython project directory relative to home:
BrickPythonDir=$(cd $(dirname $0);echo $PWD)
BrickPythonRelativeDir=${BrickPythonDir#$HOME/}
(
cd ~
tar cf - $BrickPythonRelativeDir | ssh pi@raspberrypi "(rm -rf $BrickPythonRelativeDir; tar xf -)"
)
ssh -t pi@raspberrypi "(export DISPLAY=:1.0; cd $WorkingRelDir; $*)"