#!/bin/sh
HERE=$(dirname $(readlink -f $0))
. $HERE/../../../profile

# machine to check for
MACHINE=chinaman
MACHINE_KEY=$MDIR/keys/$MACHINE
LF=${MACHINE}_ati_temper
mkdir -p $ADIR
mkdir -p $LDIR

# write into live directory and archive
[ ! -e $MACHINE_KEY ] && echo "No Key for $MACHINE" && exit 1
echo "$(date +%Y-%m-%dT%H:%M:%S) $(ssh -i $MACHINE_KEY worker@$MACHINE '~/bin/ati_temper')" | tee $LDIR/$LF >> $ADIR/$LF