diff options
author | Micah Anderson <micah@riseup.net> | 2006-10-06 20:00:52 +0000 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2006-10-06 20:00:52 +0000 |
commit | 947309699dfca7a5db6d8148d46627d502a98d42 (patch) | |
tree | 3b0fcd66a4a7ee3cc6884bec86f709e098e63727 /handlers | |
parent | 911ae7d54809babedc3a8f324b3974acbc4c12fb (diff) | |
download | backupninja-947309699dfca7a5db6d8148d46627d502a98d42.tar.gz backupninja-947309699dfca7a5db6d8148d46627d502a98d42.tar.bz2 |
added ldaphost and tls variable as requested by stefani
Diffstat (limited to 'handlers')
-rw-r--r-- | handlers/ldap | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/handlers/ldap b/handlers/ldap index ee46831..ba3d78a 100644 --- a/handlers/ldap +++ b/handlers/ldap @@ -12,6 +12,14 @@ getconf restart no getconf method ldapsearch getconf passwordfile getconf binddn +getconf ldaphost +getconf tls yes + +if [ $tls = 'yes' ] + URLBASE="ldaps" +else + URLBASE="ldap" +fi status="ok" @@ -54,9 +62,17 @@ if [ "$ldif" == "yes" ]; then debug "$execstr" else if [ "$compress" == "yes" ]; then - execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile | $GZIP" + 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 else - execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile" + 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 fi [ -f "$passwordfile" ] || fatal "Password file $passwordfile not found. When method is set to ldapsearch, you must also specify a password file." debug "$execstr" |