#!/bin/sh
# Stop the broker, check for errors.
# 
export QPID_PORT=`cat qpidd.port`
rm -f qpidd.port

../qpidd --quit || ERROR=$?

# Check qpidd.log.
grep -a 'warning\|error\|critical' qpidd.log && {
    echo "WARNING: Suspicious broker log entries in qpidd.log, above."
}

# Check valgrind log.
if test -n "$VALGRIND"; then
    source `dirname $0`/vg_check
    vg_check qpidd.vglog
fi

exit $ERROR
