#!/bin/sh

# Sets configuration data
#
# usage: setconf <name> <value>
#
# Runs configutil on the Messaging Server instance database
#

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

name=""
values=""

# Get arguments
#
if [ -n "$1" ] ; then
    name="$1"
    if [ -n "$2" ] ; then
   	shift			# $2 becomes $1
	values="$@"
    fi
fi

# If no name or value is specified, list usage
#
if [ -z "${name}" -o -z "${values}" ] ; then
    echo usage: setconf attr value
    exit 1
fi

cd ${MSGADMINBIN} && ./configutil -o "${name}" -v "${values}";
exit $?

