# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
-## Copyright 1998-2011 The OpenLDAP Foundation.
+## Copyright 1998-2012 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
(
$LDAPSEARCH -D cn=config -H $URI1 -y $CONFIGPWF -bcn=config -E \!sync=rp >/dev/null 2>&1
RC=$?
- touch $RCOUT
+ echo $RC > $RCOUT
exit $RC
) &
if test -f "$RCOUT" ; then
wait $SEARCHPID
- SEARCHRC=$?
+ SEARCHRC=`cat $RCOUT`
echo "Checking return code of backgrounded RefreshAndPersist search ..."
- if test $SEARCHRC != 52 ; then
- echo "Error: Backgrounded ldapsearch did return the wrong error code: $SEARCHRC"
+ if test 52 != "$SEARCHRC" ; then
+ echo "Error: Backgrounded ldapsearch returned the wrong error code: $SEARCHRC"
RC=1
else
echo "Exit code correct."