#!/bin/sh
# vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent
SLEEPSECS=4

message() {
        echo "$1" >&2
}

ALREADY=`ps auxww | grep warn-queue | grep -v grep`
if test "x$ALREADY" != "x"; then
	message "warn-queue is already running. $0 will exit now."
	exit 1
fi

run_warnq()
{
	while :; do
		/usr/local/astium/web/html/warn-queue -d 1 > /dev/null 2>&1
		EXITSTATUS=$?
		message "Warn-queue ended with exit status $EXITSTATUS"
		message "Automatically restarting warn-queue."
		sleep $SLEEPSECS
		
	done
}

run_warnq &

