#{{PERL-EXEC}}
#
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
# Copyright (C) 2013 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details. 
# END COPYRIGHT BLOCK
#

use lib qw(/usr/lib64/dirsrv/perl);
use DSUtil qw(shellEscape);

# We lose args that are quoted when passing ARGV to a wrapper
while ($i <= $#ARGV) {
        if($ARGV[$i] =~ /^-/){
                $wrapperArgs[$i] = $ARGV[$i];
        } else {
                $wrapperArgs[$i] = shellEscape($ARGV[$i]);
        }
        $i++;
}

exec "{{SERVERBIN-DIR}}/db2index.pl @wrapperArgs -Z {{SERV-ID}}";

exit ($?);
