#!/bin/sh
ADMIN=sqlrelay

DIRTY_S=`ipcs -s | grep $ADMIN | wc -l`
DIRTY_M=`ipcs -m | grep $ADMIN | wc -l`

if test $DIRTY_S -ne 0 ; then
   ipcrm -s `ipcs -s | grep $ADMIN | cut -f2 -d ' '`
fi;
if test $DIRTY_M -ne 0 ; then
   ipcrm -m `ipcs -m | grep $ADMIN | cut -f2 -d ' '`
fi;

echo "Interprocess buffers cleaned";
exit 0
