annotate tools/pibake.in @ 1:b5139af1a420 tip basis

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