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