#!/bin/bash
TMPFILE=`mktemp /tmp/batch_update.XXXXXXXXXX`
trap "rm -f $TMPFILE" 0
cat >$TMPFILE <<xEOFx
Universe   = vanilla
Executable = /usr/share/oasis/oasis-batch-worker
notification = Never
getenv = True
Log        = /dev/null
Output     = /dev/null
Error      = /dev/null
xEOFx
## determine the vo requesting the update
vo=`whoami | awk -F. '{print $2}'`
echo "Arguments = $vo" >> $TMPFILE
echo "Queue" >> $TMPFILE
if condor_submit $TMPFILE; then
    sleep 2
    echo "You can use condor_q to check on the status of your update"
fi
