#!/bin/sh

# Run counterutil on the Messaging Server instance database
#

PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/etc:${PATH}
SERVERROOT=<msg.RootPath>
MSGADMINBIN=${SERVERROOT}/lib
INSTANCEDIR=<msg.RootPath>/<msg.ServerName>
CONFIGROOT=${INSTANCEDIR}
export SERVERROOT INSTANCEDIR CONFIGROOT PATH

# Start environment variable settings
#
# LIBPATH is set for AIX 4+
# SHLIB_PATH is set for HPUX 11+
# LD_LIBRARY_PATH used for Solaris 2.5+, SCO Unix, IRIX, Linux
ADDPATH=${SERVERROOT}/lib
LD_LIBRARY_PATH=${ADDPATH}:${LD_LIBRARY_PATH}
LIBPATH=${ADDPATH}:${LIBPATH}
SHLIB_PATH=${ADDPATH}:${SHLIB_PATH}
SUID_OK_LIBPATH=${LIBPATH}
export LD_LIBRARY_PATH LIBPATH SHLIB_PATH SUID_OK_LIBPATH

cd ${MSGADMINBIN} && ./counterutil "$@"
exit $?
