comparison tools/pibake.in @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 #!/bin/bash
2
3 DIR='@DIR@'
4 HOST=zeta
5 TOKEN=$DIR/guest_rsa
6 TOKSRC=/users/mike/pi/guest_rsa
7 PROG=$1
8
9 # Check that we have the login token
10 if ! [ -r $TOKEN ]; then
11 if [ -r $TOKSRC ]; then
12 cp $TOKSRC $TOKEN
13 else
14 echo "pibake: Please get the correct guest_rsa file from Mike" >&2
15 exit 2
16 fi
17 fi
18
19 # Make sure the token is private
20 chmod og-rwx $TOKEN
21
22 # Make sure socket directory exists
23 mkdir -p ~/.ssh/sockets
24
25 dir="user/$USER"
26 lib=/home/guest/lib
27
28 # Form batch job and submit it to the Pi
29 ( echo mkdir -p $dir
30 echo cd $dir
31 echo 'cat >b.s <<\EOF'
32 cat $1
33 echo EOF
34 echo "(set -x; gcc -I $lib $lib/pas0.o b.s -o b.out && ./b.out)"
35 echo rm -f b.s b.out ) \
36 | ssh -F $DIR/sshconfig $HOST /bin/bash
37