#! /bin/sh
# Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany
#
# init.d/wpmd
#
### BEGIN INIT INFO
# Provides:       wpmd
# Required-Start: $network $remote_fs apache squid
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:
# Description:    Starts the wpm-daemon
### END INIT INFO

. /etc/rc.config
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

. /etc/rc.status
rc_reset
ServerNames="ttaldap ttacache ttaldap2 ttacache2"
ServerNames="ttaldap ttacache "

case "$1" in
    start)
        echo -n "Activando Servidores LDAP Iplanet:"
        for nom in `echo $ServerNames` 
        do 
            /opt/netscape/ldap/slapd-$nom/start-slapd
	    [ $? -eq 0 ] && echo -n " $nom "
        done
	rc_status -v
	;;
    stop)
	echo -n "Shutting down Iplanet LDAP: "
        for nom in `echo $ServerNames` 
        do 
            /opt/netscape/ldap/slapd-$nom/stop-slapd
	    [ $? -eq 0 ] && echo -n " $nom "
	    #[ $? -ne 0 ] && echo -n "- Warning: error al desconectar ($nom)! "
        done
	rc_status -v
	;;
    restart)
	$0 stop
	$0 start
	rc_status
	;;
    status)
	echo -n "Checking Netscape LDAP "
        ps -ef | fgrep slapd
#	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
	;;
esac
rc_exit

