#! /bin/sh

#enter the total time you want to allow the mission to run for in seconds
TOTAL_MISSION_TIME=11400
#the name of the script you want to run. This should either be an absolute
#path, or the path will need to be correct relative to the location of this
#script.
MISSION_SCRIPT="jan0207_newmission.rb"

echo "running \"ruby $MISSION_SCRIPT &\""
ruby $MISSION_SCRIPT &
PID=$!
echo "Mission is running under PID $PID"
echo "Mission will be killed in $TOTAL_MISSION_TIME seconds"
sleep $TOTAL_MISSION_TIME
echo "killing mission script"
kill -9 $PID
echo "shutting down relays"
echo -ne "f0\r" > /dev/relay
