xref: /titanic_41/usr/src/cmd/ldapcachemgr/ldap-client (revision 9e2871ec787069e5a50ceec41f190366f4c89c8e)
1*9e2871ecSrm88369#!/sbin/sh
2*9e2871ecSrm88369#
3*9e2871ecSrm88369# CDDL HEADER START
4*9e2871ecSrm88369#
5*9e2871ecSrm88369# The contents of this file are subject to the terms of the
6*9e2871ecSrm88369# Common Development and Distribution License (the "License").
7*9e2871ecSrm88369# You may not use this file except in compliance with the License.
8*9e2871ecSrm88369#
9*9e2871ecSrm88369# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*9e2871ecSrm88369# or http://www.opensolaris.org/os/licensing.
11*9e2871ecSrm88369# See the License for the specific language governing permissions
12*9e2871ecSrm88369# and limitations under the License.
13*9e2871ecSrm88369#
14*9e2871ecSrm88369# When distributing Covered Code, include this CDDL HEADER in each
15*9e2871ecSrm88369# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*9e2871ecSrm88369# If applicable, add the following below this CDDL HEADER, with the
17*9e2871ecSrm88369# fields enclosed by brackets "[]" replaced with your own identifying
18*9e2871ecSrm88369# information: Portions Copyright [yyyy] [name of copyright owner]
19*9e2871ecSrm88369#
20*9e2871ecSrm88369# CDDL HEADER END
21*9e2871ecSrm88369#
22*9e2871ecSrm88369#
23*9e2871ecSrm88369# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*9e2871ecSrm88369# Use is subject to license terms.
25*9e2871ecSrm88369#
26*9e2871ecSrm88369#ident	"%Z%%M%	%I%	%E% SMI"
27*9e2871ecSrm88369
28*9e2871ecSrm88369#
29*9e2871ecSrm88369# Start/Stop client LDAP service
30*9e2871ecSrm88369#
31*9e2871ecSrm88369
32*9e2871ecSrm88369. /lib/svc/share/smf_include.sh
33*9e2871ecSrm88369
34*9e2871ecSrm88369case "$1" in
35*9e2871ecSrm88369'start')
36*9e2871ecSrm88369	if [ ! -r /var/ldap/ldap_client_file ]; then
37*9e2871ecSrm88369		echo "WARNING: /var/ldap/ldap_client_file is missing or not readable" >& 2
38*9e2871ecSrm88369		exit $SMF_EXIT_ERR_CONFIG
39*9e2871ecSrm88369	fi
40*9e2871ecSrm88369
41*9e2871ecSrm88369	exec /usr/lib/ldap/ldap_cachemgr
42*9e2871ecSrm88369	;;
43*9e2871ecSrm88369
44*9e2871ecSrm88369'stop')
45*9e2871ecSrm88369	exec /usr/lib/ldap/ldap_cachemgr -K
46*9e2871ecSrm88369	;;
47*9e2871ecSrm88369
48*9e2871ecSrm88369*)
49*9e2871ecSrm88369	echo "Usage: $0 { start | stop }"
50*9e2871ecSrm88369	exit 1
51*9e2871ecSrm88369	;;
52*9e2871ecSrm88369esac
53