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

../qpidd --quit || ERROR=1

# 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_LOG*
    vg_check qpidd.vglog* || ERROR=1
fi

exit $ERROR
