diff options
author | Leif Johansson <leifj@sunet.se> | 2011-01-26 14:42:17 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-01-26 14:42:17 +0100 |
commit | 4a19966c3bb9f7dce1cca158163d583a33458723 (patch) | |
tree | bbe55f7b708c52011052c9bf9afdddc6be4a9755 /dirsh |
import
Diffstat (limited to 'dirsh')
-rwxr-xr-x | dirsh | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#!/usr/bin/env perl + +use lib './blib/lib/'; +use LDAPShell; +use Getopt::Long; + +my $usage=<<EOU; +Usage: $0 + +$0 is a command-line shell for administration of directory-based information. +Using $0 it is possible to add, delete and modify entries in a directory. The +shell presents a filesystem-like interface (with some support for tab-completion +of directory names) to a directory server. + +$0 always runs over a secure connection (using TLS) and will not start unless +the START_TLS extended operation is supported by the directory server. + +$0 implements a basic set of unix-like command look-alikes (cd,ls,pwd etc) +together with a few ldap-specific commands (modify,add,delete) and add-ons which +perform specific tasks (for instance the 'user' command which looks up a user based +on the 'uid' attribute). + +$0 supports the notion of basic batch-file like scripts. These script are simply +lines which are executed one line at a time with simple substitution of command +line arguments from the batch-file call (%{0} is the first variable etc etc). Such +scripts can be used to automate tasks (creating new users, gropus, or adding members +to groups for instance). + +EOU + +my %args = ('verbose'=>0,'help'=>0); +my @args = ("config=s","verbose+","help!","template=s"); +GetOptions(\%args,@args) or die $usage; +die $usage if $args{help}; + +my $shell = LDAPShell->new($ini); +$shell->loop(); |