#!/bin/sh
#
# $Id: slave 1119 2005-01-25 14:21:45Z jorge $
#
# Slave starting program that restarts the slave after failure
#

if [ ! $DRQUEUE_ROOT ]; then
  echo ERROR: DRQUEUE_ROOT not set in environment
  exit 1
fi

if [ ! $DRQUEUE_MASTER ]; then
  echo ERROR: DRQUEUE_MASTER not set in environment
  exit 2
fi

SLAVE_CMD=$DRQUEUE_ROOT/bin/slave.`uname -s`

if [ ! -x $SLAVE_CMD ]; then
  echo ERROR: slave for your platform \(slave.`uname -s`\) does not exist in $DRQUEUE_ROOT/bin.
  echo Perhaps you did not install it \(make miniinstall or make install\).
  exit 3
fi

while [ 1 ]; do
  $SLAVE_CMD $*
  sleep 60
done
