#!/bin/sh
#
# //  DESCRIPTION:
# //      Controls the WAS Collection Services function.

. $(/usr/bin/dirname $0)/setupCmdLine

rearg_match_arg_with_value()
{
  local matched=1
  case $1 in
    -instance)    dspntvmsg WAS7001
                  specify_profile $2 ;;
    -profileName) specify_profile $2 ;;
    -server.name) server=$2 ;;
    *)            matched=0  ;;
  esac
  return $matched
}

rearg_match_boolean_arg()
{
  local matched=1
  case $1 in
     -enable) mode=enable  ;;
    -disable) mode=disable ;;
     -status) mode=status  ;;
    -viewlog) mode=viewlog ;;
         -\?) mode=help    ;;
       -help) mode=help    ;;
           *) matched=0    ;;
  esac
  return $matched
}


mode=usage
server=$WAS_PROFILE_NAME
if [ "$WAS_PROFILE_NAME" = "default" ]; then
  server=server1
fi

. $(/usr/bin/dirname $0)/.rearg

$(/usr/bin/dirname $0)/wsadmin -conntype NONE -profileName ${WAS_PROFILE_NAME} "$@" -wsadmin_classpath ${WAS_INSTALL_ROOT}/util/manageWASCollectionServices.jar -f ${WAS_INSTALL_ROOT}/util/manageWASCollectionServices.jacl $mode $server
