view tools/pibake.in @ 1:b683d796e07e tip basis

Added generated Keiko files
author Mike Spivey <mike@cs.ox.ac.uk>
date Mon, 10 Sep 2018 20:34:00 +0100
parents 5dd13b8deb54
children
line wrap: on
line source
#!/bin/bash

DIR='@DIR@'
HOST=zeta
TOKEN=$DIR/guest_rsa
TOKSRC=/users/mike/pi/guest_rsa
PROG=$1

# Check that we have the login token
if ! [ -r $TOKEN ]; then
    if [ -r $TOKSRC ]; then
        cp $TOKSRC $TOKEN
    else
        echo "pibake: Please get the correct guest_rsa file from Mike" >&2
        exit 2
    fi
fi

# Make sure the token is private
chmod og-rwx $TOKEN

# Make sure socket directory exists
mkdir -p ~/.ssh/sockets

dir="user/$USER"
lib=/home/guest/lib

# Form batch job and submit it to the Pi
( echo mkdir -p $dir
  echo cd $dir
  echo 'cat >b.s <<\EOF'
  cat $1
  echo EOF
  echo "(set -x; gcc -I $lib $lib/pas0.o b.s -o b.out && ./b.out)"
  echo rm -f b.s b.out ) \
| ssh -F $DIR/sshconfig $HOST /bin/bash