#!/usr/bin/env perl use warnings; use strict; use POSIX; my $action; eval { POSIX::setgid( scalar( getgrnam('__APACHEGROUP__') ) ); POSIX::setuid( scalar( getpwnam('__APACHEUSER__') ) ); }; for ( my $i = 0 ; $i < @ARGV ; $i++ ) { if ( $ARGV[$i] =~ /^-/ ) { $i++; next; } $action = $ARGV[$i]; last; } $action ||= "help"; if ( $action =~ /^(?:[gs]et|(?:add|del)Key)$/ ) { eval { require Lemonldap::NG::Manager::Cli; }; die "Manager libraries not available, aborting ($@)" if ($@); Lemonldap::NG::Manager::Cli->run(@ARGV); } elsif ( $action =~ /^(?:info|update-cache)$/ ) { eval { require Lemonldap::NG::Common::Cli; }; die "Lemonldap::NG common libraries not available, aborting ($@)" if ($@); Lemonldap::NG::Common::Cli->run(@ARGV); } else { help(); } sub help { print STDERR qq{Usage: $0 action Available actions: - help : print this - info : get currentconfiguration info - update-cache : force configuration cache to be updated - get : get values of parameters - set : set parameter(s) value(s) - addKey : add or set a subkey in a parameter - delKey : delete subkey of a parameter See Lemonldap::NG::Common::Cli(3) or Lemonldap::NG::Manager::CLi(3) for more }; } __END__ =head1 NAME =encoding utf8 lemonldap-ng-cli - Command-line manager for Lemonldap::NG web-SSO system. =head1 SYNOPSIS # Get information about current configuration $ lemonldap-ng-cli info # Update local configuration cache $ lemonldap-ng-cli update-cache # Get some configuration parameter values $ lemonldap-ng-cli get portal domain cookieName # Set some values $ lemonldap-ng-cli set portal http://auth.e.com/ domain e.com # add or set a key $ lemonldap-ng-cli addKey macro fullname '$givenName." ".$lastName' =head1 DESCRIPTION lemonldap-ng-cli is a command line client that can be used to do some actions on Lemonldap::NG configuration. Commands are detailed in L and L =head1 SEE ALSO L, L L =head1 AUTHORS =over =item David Coutateur, Edavid.jose.delassus@gmail.comE =item Clement Oudot, Eclem.oudot@gmail.comE =item Xavier Guimard, Ex.guimard@free.frE =back =head1 BUG REPORT Use OW2 system to report bug or ask for features: L =head1 DOWNLOAD Lemonldap::NG is available at L =head1 COPYRIGHT AND LICENSE =over =item Copyright (C) 2016 by Xavier Guimard, Ex.guimard@free.frE =item Copyright (C) 2016 by Clément Oudot, Eclem.oudot@gmail.comE =back This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. 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. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see L. =cut