LDAP   [plain text]


#!/bin/sh

##
# LDAP server
##

. /etc/rc.common

StartService ()
{
    ##
    # Start up LDAP server
    ##
    if [ "${LDAPSERVER:=-NO-}" = "-YES-" ]; then
        if ! pid=$(GetPID slapd); then
            ConsoleMessage "Starting LDAP server"
            slapd
        fi
    fi
}

StopService ()
{
    if pid=$(GetPID slapd); then
        ConsoleMessage "Stopping LDAP server"
        kill -INT "${pid}"
    else
        ConsoleMessage "LDAP server is not running."
    fi
}

RestartService ()
{
    StopService
    StartService
}


RunService "$1"