- touch $dumpdir/$dbsuffix.ldif
- if [ ! -f $dumpdir/$dbsuffix.ldif ]; then
- fatal "Couldn't create ldif dump file: $dumpdir/$dbsuffix.ldif"
+
+ if [ "$method" == "slapcat" ]; then
+ execstr="$SLAPCAT -f $conf -b $dbsuffix"
+ if [ "$restart" == "yes" ]; then
+ debug "Shutting down ldap server..."
+ /etc/init.d/slapd stop
+ fi
+ debug "$execstr"
+ else
+ execstr="$LDAPSEARCH -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
+ [ -f "$passwordfile" ] || fatal "Password file $passwordfile not found"
+ if [ "$restart" == "yes" ]; then
+ debug "Shutting down ldap server..."
+ /etc/init.d/slapd stop
+ fi
+ debug "$execstr"