#!/usr/bin/perl

#
# $Id: sysadmin, matt Exp $
#

use strict;
use Sys::Hostname;

use lib "lib";
use Mail::Toaster::Utility   5;  my $utility = Mail::Toaster::Utility->new();
use Mail::Toaster::Provision 5;

use vars qw/ $VERSION $iam $whoami /;

$VERSION = "5.05";

my $conf = $utility->parse_config( file=>"sysadmin.conf", debug=>0 );

# Redirect STDERR to STDOUT so we can see what's printed out in a die() call.
#open(STDERR, ">&STDOUT");
#select(STDERR); $|=1; select(STDOUT); $|=1;

my $provision = Mail::Toaster::Provision->new();

$provision->{'conf'} = $conf;

$iam = $provision->what_am_i();
exit unless $provision->what_am_i_check($iam);

$provision->{'iam'} = $iam;

   $iam eq "dnsadmin"  ? $provision->dns () 
 : $iam eq "mailadmin" ? $provision->mail()
 : $iam eq "useradmin" ? $provision->user()
 : $iam eq "webadmin"  ? $provision->web ()
 : $provision->usage();


=head1 NAME

sysadmin - a set of provisioning scripts used to manage users, email accounts and apache vhosts

=head1 SYNOPSIS



=head1 DESCRIPTION

sysadmin began as a provisioning agent maildomain, later renamed
mailadmin, and finally evolving into sysadmin. It allows 
non-root users to perform admin tasks on behalf of end users 
(ie, for tech support personnel) and automated provisioning by a
back office system. 


=head1 Dependencies

 Quota  (for file system quotas)
 Apache::ConfigFile

=cut

