} else if ( !strncasecmp( cargv[ i ],
INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) ) {
val = cargv[ i ] + sizeof( INTERVALSTR );
- if ( si->type == LDAP_SYNC_REFRESH_AND_PERSIST )
+ if ( si->type == LDAP_SYNC_REFRESH_AND_PERSIST ) {
si->interval = 0;
- else
- si->interval = atoi( val );
+ } else {
+ char *dstr;
+ char *hstr;
+ char *mstr;
+ dstr = val;
+ hstr = strchr( dstr, ':' );
+ if ( hstr == NULL ) {
+ fprintf( stderr, "Error: parse_syncrepl_line: "
+ "invalid interval \"%s\"\n", val );
+ return 1;
+ }
+ *hstr++ = '\0';
+ mstr = strchr( hstr, ':' );
+ if ( mstr == NULL ) {
+ fprintf( stderr, "Error: parse_syncrepl_line: "
+ "invalid interval \"%s\"\n", val );
+ return 1;
+ }
+ *mstr++ = '\0';
+ si->interval = (( atoi( dstr ) * 24 + atoi( hstr )) * 60
+ + atoi( mstr )) * 60;
+ fprintf(stderr, "interval = %d\n", si->interval );
+ }
if ( si->interval < 0 ) {
fprintf( stderr, "Error: parse_syncrepl_line: "
"invalid interval \"%ld\"\n",
exit $RC
fi
-echo "Waiting 30 seconds for syncrepl to receive changes..."
-sleep 30
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
echo "Using ldapmodify to modify master directory..."
EOMODS
-echo "Waiting 30 seconds for syncrepl to receive changes..."
-sleep 30
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
exit $RC
fi
-echo "Waiting 60 seconds for syncrepl to receive changes..."
-sleep 60
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
echo "Using ldapmodify to modify master directory..."
EOMODS
-echo "Waiting 60 seconds for syncrepl to receive changes..."
-sleep 60
+echo "Waiting 90 seconds for syncrepl to receive changes..."
+sleep 90
echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \