From 1b424a51418bf2f5451f412a0fdd45f7c1049e33 Mon Sep 17 00:00:00 2001 From: rread Date: Wed, 2 Jul 2003 16:26:42 +0000 Subject: [PATCH] Use the correct path for the XSL and top.ldif when installed from the rpm. --- lustre/utils/load_ldap.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lustre/utils/load_ldap.sh b/lustre/utils/load_ldap.sh index 531d385..e914827 100755 --- a/lustre/utils/load_ldap.sh +++ b/lustre/utils/load_ldap.sh @@ -13,6 +13,15 @@ LDAP_PW=${LDAP_PW:-secret} LDAP_AUTH="-x -D $LDAP_ROOTDN -w $LDAP_PW" LUSTRE=${LUSTRE:-`dirname $0`/..} +if [ -f $LUSTRE/Makefile.am ]; then + CONFDIR=$LUSTRE/conf +else + CONFDIR=/usr/lib/lustre +fi + +TOP=$CONFDIR/top.ldif +XSL=$CONFDIR/lustre2ldif.xsl + [ ! -z $LDAPURL ] && LDAP_AUTH="$LDAP_AUTH -H $LDAPURL" XML=${XML:-$1} @@ -27,13 +36,13 @@ LDIF=/tmp/$NAME.ldif # add the top level record, if needed ldapsearch $LDAP_AUTH -b $LDAP_BASE > /dev/null 2>&1 || - ldapadd $LDAP_AUTH -f $LUSTRE/conf/top.ldif + ldapadd $LDAP_AUTH -f $TOP # If this config already exists, then delete it ldapsearch $LDAP_AUTH -b config=$NAME,$LDAP_BASE > /dev/null 2>&1 && ldapdelete $LDAP_AUTH -r config=$NAME,$LDAP_BASE -4xslt -D config=$NAME $XML $LUSTRE/conf/lustre2ldif.xsl > $LDIF +4xslt -D config=$NAME $XML $XSL > $LDIF echo "Loading config to 'config=$NAME,$LDAP_BASE' ..." ldapadd $LDAP_AUTH -f $LDIF -- 1.8.3.1