#!/bin/bash
# -------------------------------------------------------------------
# File: remctl-ldap-repl-check
# Author: Bill MacAllister <bill@ca-zephyr.org>
# Copyright (c) 2018 Dropbox, Inc.
# Copyright (C) 2023 CZ Software
# Description: Wrapper script around the script ldap-repl-check
#              to allow use of the script from remctl.

function display_help {
    echo -n 'Usage: '
    echo 'remctl-ldap-repl-check [<ldap-repl-check options and parameters>]'
    exit 1
}

this_script=/usr/sbin/ldap-repl-check
this_tgt=FILE:/run/service-ldap.tgt
export PATH=/usr/sbin:$PATH
if [ "$1" = "check" ]
then
   shift
fi
if [ "$1" = "buildtest" ]
then
    display_help
else
    KRB5CCNAME=$this_tgt $this_script $*
fi

exit

# Documentation.  Because of the above exit line, this should never be
# executed.
DOCS=<<__END_OF_DOCS__
=head1 NAME

remctl-ldap-repl-check - this is a remctl wrapper for ldap-repl-check

=head1 SYNOPSIS

remctl-ldap-repl_check <ldap-repl-check options and parameters>

=head1 DESCRIPTION

This script is a remctl wrapper around the script ldap-repl-check.

=head1 SEE ALSO

ldap-repl-check

=head1 AUTHOR

Bill MacAllister <bill@ca-zephyr.org>

=head1 COPYRIGHT

Copyright (C) 2018 Dropbox Inc.
Copyright (C) 2023 CZ Software

This code is free software; you can redistribute it and/or modify it
under the same terms as Perl. For more details, see the full
text of the at https://opensource.org/licenses/Artistic-2.0.

This program is distributed in the hope that it will be
useful, but without any warranty; without even the implied
warranty of merchantability or fitness for a particular purpose.

=cut
__END_OF_DOCS__
