3972N/A#! /bin/sh
3972N/A#
3972N/A# CDDL HEADER START
3972N/A#
3972N/A# The contents of this file are subject to the terms of the
3972N/A# Common Development and Distribution License, Version 1.0 only
3972N/A# (the "License"). You may not use this file except in compliance
3972N/A# with the License.
3972N/A#
3972N/A# You can obtain a copy of the license at
3972N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE
3972N/A# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
3972N/A# See the License for the specific language governing permissions
3972N/A# and limitations under the License.
3972N/A#
3972N/A# When distributing Covered Code, include this CDDL HEADER in each
3972N/A# file and include the License file at
3972N/A# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
3972N/A# add the following below this CDDL HEADER, with the fields enclosed
3972N/A# by brackets "[]" replaced with your own identifying information:
3972N/A# Portions Copyright [yyyy] [name of copyright owner]
3972N/A#
3972N/A# CDDL HEADER END
3972N/A#
3972N/A#
3972N/A# Copyright 2008 Sun Microsystems, Inc.
3972N/A
3972N/A. /lib/svc/share/smf_include.sh
3972N/A
3972N/ASTARTDS="/usr/opends/bin/start-ds --exec"
3972N/ASTOPDS="/usr/opends/bin/stop-ds --exec"
3972N/ATEST="/usr/bin/test"
3972N/A
3972N/Acase "$1" in
3972N/A'start')
3972N/A OPENDS_JAVA_HOME="${OPENDS_JAVA_HOME}" \
3972N/A OPENDS_JAVA_ARGS="${OPENDS_JAVA_ARGS}" ${STARTDS}
3972N/A RES=$?
3972N/A if ${TEST} ${RES} -ne 0
3972N/A then
3972N/A if ${TEST} ${RES} -eq 98
3972N/A then
3972N/A# Already started
3972N/A exit ${SMF_EXIT_OK}
3972N/A else
3972N/A exit ${SMF_EXIT_ERR_FATAL}
3972N/A fi
3972N/A fi
3972N/A ;;
3972N/A
3972N/A'stop')
3972N/A OPENDS_JAVA_HOME="${OPENDS_JAVA_HOME}" ${STOPDS}
3972N/A if ${TEST} $? -ne 0
3972N/A then
3972N/A exit ${SMF_EXIT_ERR_FATAL}
3972N/A fi
3972N/A ;;
3972N/A*)
3972N/A echo "Usage: $0 { start | stop }"
3972N/A exit ${SMF_EXIT_ERR_FATAL}
3972N/A ;;
3972N/Aesac
3972N/Aexit ${SMF_EXIT_OK}