Author: tchemineau
Date: 2010-09-23 12:11:19 +0200 (Thu, 23 Sep 2010)
New Revision: 134
Modified:
openldap-mmr/trunk/functions
openldap-mmr/trunk/mmr-addnode
openldap-mmr/trunk/mmr-initprov
openldap-mmr/trunk/mmr-migrate
openldap-mmr/trunk/mmr-passwd
Log:
fixe #279 - auto calculate path, and include openldap path to make ldapsearch
and slapadd work
Modified: openldap-mmr/trunk/functions
===================================================================
--- openldap-mmr/trunk/functions 2010-09-23 09:40:17 UTC (rev 133)
+++ openldap-mmr/trunk/functions 2010-09-23 10:11:19 UTC (rev 134)
@@ -44,6 +44,7 @@
LDAP_TLS_REQCERT="0"
LDAP_USERNAME="ldap"
LDAP_GROUPNAME="ldap"
+OPENLDAP_INSTALL_DIR="/usr/local/openldap"
# Do not forget to load the configuration file while this file is loaded. It
# will normaly override those parameters.
@@ -245,6 +246,28 @@
}
#
+# Check available binaries.
+#
+CHECK_OPENLDAP_BINARIES ()
+{
+ if [ -z "`which ldapsearch`" ]; then
+ bin="`find $OPENLDAP_INSTALL_DIR -name ldapsearch -print 2> /dev/null`"
+ if [ -z "${bin}" ]; then
+ return 1
+ fi
+ export PATH="`dirname ${bin}`:$PATH"
+ fi
+ if [ -z "`which slapadd`" ]; then
+ bin="`find $OPENLDAP_INSTALL_DIR -name slapadd -print 2> /dev/null`"
+ if [ -z "${bin}" ]; then
+ return 1
+ fi
+ export PATH="`dirname ${bin}`:$PATH"
+ fi
+ return 0
+}
+
+#
# Search for the configuration directory.
#
get_config_olcConfigDir ()
Modified: openldap-mmr/trunk/mmr-addnode
===================================================================
--- openldap-mmr/trunk/mmr-addnode 2010-09-23 09:40:17 UTC (rev 133)
+++ openldap-mmr/trunk/mmr-addnode 2010-09-23 10:11:19 UTC (rev 134)
@@ -32,9 +32,6 @@
# This script provides some automatic installation of a OpenLDAP
# consumer into an OpenLDAP 2.4 cluster.
#
-# Be carefull that PATH should have provide those following
-# commands :
-#
. "`dirname $0`/functions"
. "`dirname $0`/openldap-mmr.conf"
@@ -45,7 +42,6 @@
ACTIONS=""
DEFAULT_BOOTSTRAP="`dirname $0`/bootstrap/node.bootstrap"
-PATH="$OPENLDAP_INSTALL_DIR/bin:$OPENLDAP_INSTALL_DIR/sbin:$PATH"
# ----------------------------------------------------------------
# FUNCTIONS
@@ -115,6 +111,14 @@
# -- Common --
+CHECK_OPENLDAP_BINARIES
+if [ $? -ne 0 ]; then
+ echo "Can not find openldap binaries"
+ exit 1
+fi
+
+# -- Ask for parameters --
+
echo ""
echo " Available local IP addresses:"
echo ""
Modified: openldap-mmr/trunk/mmr-initprov
===================================================================
--- openldap-mmr/trunk/mmr-initprov 2010-09-23 09:40:17 UTC (rev 133)
+++ openldap-mmr/trunk/mmr-initprov 2010-09-23 10:11:19 UTC (rev 134)
@@ -32,9 +32,6 @@
# This script provides some automatic installation of a primary OpenLDAP
# provider into an OpenLDAP 2.4 cluster.
#
-# Be carefull that PATH should have provide those following
-# commands :
-#
. "`dirname $0`/functions"
. "`dirname $0`/openldap-mmr.conf"
@@ -46,7 +43,6 @@
ACTIONS=""
DEFAULT_BOOTSTRAP="`dirname $0`/bootstrap/provider.bootstrap"
LDAP_NODE_IP="${LDAP_PROVIDER_IP}"
-PATH="$OPENLDAP_INSTALL_DIR/bin:$OPENLDAP_INSTALL_DIR/sbin:$PATH"
# ----------------------------------------------------------------
# FUNCTIONS
@@ -198,6 +194,14 @@
# -- Common --
+CHECK_OPENLDAP_BINARIES
+if [ $? -ne 0 ]; then
+ echo "Can not find openldap binaries"
+ exit 1
+fi
+
+# -- Ask for parameters --
+
echo ""
echo " Available local IP addresses:"
echo ""
Modified: openldap-mmr/trunk/mmr-migrate
===================================================================
--- openldap-mmr/trunk/mmr-migrate 2010-09-23 09:40:17 UTC (rev 133)
+++ openldap-mmr/trunk/mmr-migrate 2010-09-23 10:11:19 UTC (rev 134)
@@ -32,9 +32,6 @@
# This script provides some automatic installation of a OpenLDAP
# consumer into an OpenLDAP 2.4 cluster.
#
-# Be carefull that PATH should have provide those following
-# commands :
-#
. "`dirname $0`/functions"
. "`dirname $0`/openldap-mmr.conf"
@@ -45,7 +42,6 @@
ACTIONS=""
LDAP_NODE_IP="${LDAP_PROVIDER_IP}"
-PATH="$OPENLDAP_INSTALL_DIR/bin:$OPENLDAP_INSTALL_DIR/sbin:$PATH"
# ----------------------------------------------------------------
# FUNCTIONS
@@ -251,6 +247,14 @@
# -- Common --
+CHECK_OPENLDAP_BINARIES
+if [ $? -ne 0 ]; then
+ echo "Can not find openldap binaries"
+ exit 1
+fi
+
+# -- Ask for parameters --
+
echo ""
echo " Available local IP addresses:"
echo ""
Modified: openldap-mmr/trunk/mmr-passwd
===================================================================
--- openldap-mmr/trunk/mmr-passwd 2010-09-23 09:40:17 UTC (rev 133)
+++ openldap-mmr/trunk/mmr-passwd 2010-09-23 10:11:19 UTC (rev 134)
@@ -38,7 +38,6 @@
ACTIONS=""
LDAP_NODE_IP="${LDAP_PROVIDER_IP}"
LDAP_CONFIG_BINDPW_NEW=""
-PATH="$OPENLDAP_INSTALL_DIR/bin:$OPENLDAP_INSTALL_DIR/sbin:$PATH"
# ----------------------------------------------------------------
# FUNCTIONS
@@ -206,6 +205,14 @@
# -- Common --
+CHECK_OPENLDAP_BINARIES
+if [ $? -ne 0 ]; then
+ echo "Can not find openldap binaries"
+ exit 1
+fi
+
+# -- Ask for parameters --
+
echo ""
echo " Available local IP addresses:"
echo ""
_______________________________________________
ltb-changes mailing list
[email protected]
http://lists.ltb-project.org/listinfo/ltb-changes