aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2007-02-01 23:32:13 +0000
committerMicah Anderson <micah@riseup.net>2007-02-01 23:32:13 +0000
commitd15a347be54fea3ae44c595b454b22fb41149271 (patch)
tree006f80b1459c2cf6c49ffc498da0b25892744df1
parent5621db48e9a9319860d790ef06ad2d05f74eb0ac (diff)
downloadbackupninja-d15a347be54fea3ae44c595b454b22fb41149271.tar.gz
backupninja-d15a347be54fea3ae44c595b454b22fb41149271.tar.bz2
added some fixes from ale for the ldap handler
re-ordered the handler list in the changelog to be alpha
-rw-r--r--handlers/ldap34
1 files changed, 13 insertions, 21 deletions
diff --git a/handlers/ldap b/handlers/ldap
index ba3d78a..242755e 100644
--- a/handlers/ldap
+++ b/handlers/ldap
@@ -15,7 +15,7 @@ getconf binddn
getconf ldaphost
getconf tls yes
-if [ $tls = 'yes' ]
+if [ $tls = 'yes' ]; then
URLBASE="ldaps"
else
URLBASE="ldap"
@@ -54,25 +54,13 @@ if [ "$ldif" == "yes" ]; then
fi
if [ "$method" == "slapcat" ]; then
- if [ "$compress" == "yes" ]; then
- execstr="$SLAPCAT -f $conf -b $dbsuffix | $GZIP"
- else
- execstr="$SLAPCAT -f $conf -b $dbsuffix"
- fi
+ execstr="$SLAPCAT -f $conf -b $dbsuffix"
debug "$execstr"
else
- if [ "$compress" == "yes" ]; then
- if [ -n "$ldaphost" ]
- execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile | $GZIP"
- else
- execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile | $GZIP"
- fi
+ if [ -n "$ldaphost" ]; then
+ execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
else
- if [ -n "$ldaphost" ]
- execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
- else
- execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
- fi
+ execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
fi
[ -f "$passwordfile" ] || fatal "Password file $passwordfile not found. When method is set to ldapsearch, you must also specify a password file."
debug "$execstr"
@@ -83,13 +71,17 @@ if [ "$ldif" == "yes" ]; then
/etc/init.d/slapd stop
fi
- touch $dumpdir/$dbsuffix.ldif
- if [ ! -f $dumpdir/$dbsuffix.ldif ]; then
- fatal "Couldn't create ldif dump file: $dumpdir/$dbsuffix.ldif"
+ ext=
+ if [ "$compress" == "yes" ]; then
+ ext=".gz"
+ fi
+ touch $dumpdir/$dbsuffix.ldif$ext
+ if [ ! -f $dumpdir/$dbsuffix.ldif$ext ]; then
+ fatal "Couldn't create ldif dump file: $dumpdir/$dbsuffix.ldif$ext"
fi
if [ "$compress" == "yes" ]; then
- output=`$execstr > $dumpdir/$dbsuffix.ldif.gz`
+ output=`$execstr | $GZIP > $dumpdir/$dbsuffix.ldif.gz`
else
output=`$execstr > $dumpdir/$dbsuffix.ldif`
fi