ispman/bin ispman.notifyUsers, NONE, 1.1.2.2 ispman-agent, 1.69, 1.69.2.1 ispman.createMailbox, 1.5.6.1, 1.5.6.2 ispman.deleteMailbox, 1.4, 1.4.6.1 ispman.dnsset, 1.15, 1.15.2.1 ispman.dnsshow, 1.10, 1.10.6.1 ispman.getMailboxQuota, 1.4, 1.4.6.1 ispman.listMailboxes, 1.4, 1.4.6.1 ispman.makeDomainDirectories, 1.7, 1.7.4.1 ispman.setMailboxQuota, 1.4.6.1, 1.4.6.2 ispman.soap.server, 1.4, 1.4.2.1 ldifdiff, 1.3, 1.3.6.1 ispman.add_vhost, 1.1, NONE

Pedro Algarvio <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14538/bin

Modified Files:
      Tag: dev_1_3-cyrus_virtdomain
	ispman-agent ispman.createMailbox ispman.deleteMailbox 
	ispman.dnsset ispman.dnsshow ispman.getMailboxQuota 
	ispman.listMailboxes ispman.makeDomainDirectories 
	ispman.setMailboxQuota ispman.soap.server ldifdiff 
Added Files:
      Tag: dev_1_3-cyrus_virtdomain
	ispman.notifyUsers 
Removed Files:
      Tag: dev_1_3-cyrus_virtdomain
	ispman.add_vhost 
Log Message:
Branch is now "aparently" updated to HEAD, though debuging is needed.


--- NEW FILE: ispman.notifyUsers ---
#!/usr/bin/perl
# usage: ispman.notifyUsers <domain> <messagefile>
# Andreas John ("derjohn") 2006-07-06

package ISPMan;

BEGIN {
    use FindBin;
    unshift @INC,
      ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );

    use Getopt::Std;
    getopt( 'd', \%opts );

    unless ( $opts{'d'} && $ARGV[0] ) {
        print "usage:\n";
        print "$FindBin::Script -d <domain> </path/to/messagefile>\n";
        print "\n";
        exit;
    }
}

use ISPMan;
$ispman = ISPMan->new();
require "$FindBin::Bin/../lib/send_email_to_domain.lib";

&sendEmailToDomain( $ispman, $opts{'d'}, @ARGV[0] );

__END__



Index: ispman.soap.server
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.soap.server,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -d -r1.4 -r1.4.2.1
--- ispman.soap.server	29 Dec 2004 21:49:35 -0000	1.4
+++ ispman.soap.server	11 Sep 2006 23:31:24 -0000	1.4.2.1
@@ -1,21 +1,21 @@
-#!/usr/bin/perl
-BEGIN{
-   use FindBin; unshift @INC, ($FindBin::Bin , "$FindBin::Bin/../lib");
-   use Getopt::Std;
-}
-
-use SOAP::Lite;
-use SOAP::Transport::HTTP;
-
-  # don't want to die on 'Broken pipe' or Ctrl-C
-  #$SIG{PIPE} = $SIG{INT} = 'IGNORE';
-
-  my $port=$ARGV[0]||9999;
-  my $daemon = SOAP::Transport::HTTP::Daemon
-    -> new (LocalPort => $port, ReuseAddr =>1)
-    -> dispatch_to("$FindBin::Bin/../lib/ISPMan/SOAP", 'ISPManSoapServer');
-
-  print "Contact to SOAP server at ", $daemon->url, "\n";
-  $daemon->handle;
-
-
+#!/usr/bin/perl
+BEGIN{
+   use FindBin; unshift @INC, ($FindBin::Bin , "$FindBin::Bin/../lib");
+   use Getopt::Std;
+}
+
+use SOAP::Lite;
+use SOAP::Transport::HTTP;
+
+  # don't want to die on 'Broken pipe' or Ctrl-C
+  #$SIG{PIPE} = $SIG{INT} = 'IGNORE';
+
+  my $port=$ARGV[0]||9999;
+  my $daemon = SOAP::Transport::HTTP::Daemon
+    -> new (LocalPort => $port, ReuseAddr =>1)
+    -> dispatch_to("$FindBin::Bin/../lib/ISPMan/SOAP", 'ISPManSoapServer');
+
+  print "Contact to SOAP server at ", $daemon->url, "\n";
+  $daemon->handle;
+
+

Index: ispman.makeDomainDirectories
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.makeDomainDirectories,v
retrieving revision 1.7
retrieving revision 1.7.4.1
diff -u -d -r1.7 -r1.7.4.1
--- ispman.makeDomainDirectories	4 Aug 2004 17:25:40 -0000	1.7
+++ ispman.makeDomainDirectories	11 Sep 2006 23:31:24 -0000	1.7.4.1
@@ -2,14 +2,17 @@
 BEGIN {
     use FindBin;
     unshift @INC,
-      ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
+      (
+        $FindBin::Bin,           "$FindBin::Bin/../lib",
+        "$FindBin::Bin/../conf", "$FindBin::Bin/../tasks"
+      );
     use Getopt::Std;
     getopt( 'd', \%opts );
     unless ( $opts{'d'} ) {
         print "$FindBin::Script -d domain_name|all \n";
         print "  Examples:\n";
         print
-"  $FindBin::Script -d test.dom  (create directories for domain test.dom)\n";
+          "  $FindBin::Script -d test.dom  (create directories for domain test.dom)\n";
         print
           "  $FindBin::Script -d all  (create directories for all domains)\n";
         print "\n";
@@ -21,23 +24,29 @@
 use vars qw($ispman);
 $ispman = ISPMan->new();
 
-# defind log_message.
-# This is defined in ispman-agent and we should redefine here
-sub logsay {
-    my $message = join ' ', @_;
-    chomp($message);
-    print "$message\n";
+sub exec_task {
+    my $func   = shift;
+    my $params = shift;
+    our @cmd = ();
+
+    do $func . ".pl";
+    &{$func}($params);
+
+    my $errs = 0;
+    for (@cmd) {
+        $rc = system($_);
+        print "System: \"$_\", rc=" . $rc . "\n";
+        $errs += ( $rc == 0 ? 0 : 1 );
+    }
+    return $errs;
 }
 
-require "create_domain_directories.lib";
-require "create_vhost_directories.lib";
-require "create_home_directory.lib";
 my $domains;
 
 if ( lc( $opts{'d'} ) eq "all" ) {
     $domains = $ispman->makeDomainHash(
         $ispman->getDomains(
-'|(ispmanDomainType=primary)(ispmanDomainType=slave)(ispmanDomainType=nodns)'
+            '|(ispmanDomainType=primary)(ispmanDomainType=slave)(ispmanDomainType=nodns)'
         )
     );
 }
@@ -48,19 +57,30 @@
 for $domain ( keys %$domains ) {
     my $domInfo = $ispman->getDomainInfo($domain);
     my $dn      = $ispman->getDomainDN($domain);
-    &create_domain_directories_handler(
-        $domInfo->{'homeDirectory'},
-        $domInfo->{'uidNumber'},
-        $domInfo->{'gidNumber'}
+    exec_task(
+        "createDomainDirectories_task",
+        {
+            homeDirectory => $domInfo->{'homeDirectory'},
+            uidNumber     => $domInfo->{'uidNumber'},
+            gidNumber     => $domInfo->{'gidNumber'}
+        }
     );
+
     my $users =
       $ispman->getEntriesAsHashRef( $dn, "objectClass=ispmanDomainUser" );
     for $user ( keys %$users ) {
-        my $userInfo = $ispman->getUserInfo( $users->{$user}{'uid'} );
-        &create_home_directory_handler(
-            $users->{$user}{'homeDirectory'},
-            $users->{$user}{'uidNumber'},
-            $users->{$user}{'gidNumber'}
+        my $uid =
+          ref $users->{$user}{'uid'} eq ARRAY
+          ? $users->{$user}{'uid'}[0]
+          : $users->{$user}{'uid'};
+        my $userInfo = $ispman->getUserInfo($uid);
+        exec_task(
+            "createHomeDirectory_task",
+            {
+                homeDirectory => $userInfo->{'homeDirectory'},
+                uidNumber     => $userInfo->{'uidNumber'},
+                gidNumber     => $userInfo->{'gidNumber'}
+            }
         );
     }
     my $vhosts =
@@ -70,13 +90,19 @@
             $vhosts->{$vhost}{'ispmanVhostName'},
             $vhosts->{$vhost}{'ispmanDomain'}
         );
-        &create_vhost_directories_handler(
-            $vhosts->{$vhost}{'ispmanVhostName'},
-            $vhosts->{$vhost}{'homeDirectory'},
-            $vhosts->{$vhost}{'ispmanVhostDocumentRoot'},
-            $vhosts->{$vhost}{'ispmanVhostScriptDir'},
-            $vhosts->{$vhost}{'uidNumber'} || $domInfo->{'uidNumber'},
-            $vhosts->{$vhost}{'gidNumber'} || $domInfo->{'gidNumber'}
+        exec_task(
+            "AddVirtualHostDirectories_task",
+            {
+                homeDirectory => $vhostInfo->{'homeDirectory'},
+                uidNumber     => $vhostInfo->{'uidNumber'}
+                  || $domInfo->{'uidNumber'},
+                gidNumber => $vhostInfo->{'gidNumber'}
+                  || $domInfo->{'gidNumber'},
+                ispmanVhostDocumentRoot => $vhostInfo->{'ispmanVhostDocumentRoot'},
+                ispmanVhostScriptDir => $vhostInfo->{'ispmanVhostScriptDir'},
+                ispmanVhostLogdir  => $vhostInfo->{'ispmanVhostLogdir'},
+                ispmanVhostStatdir => $vhostInfo->{'ispmanVhostStatdir'}
+            }
         );
     }
 }

Index: ispman.listMailboxes
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.listMailboxes,v
retrieving revision 1.4
retrieving revision 1.4.6.1
diff -u -d -r1.4 -r1.4.6.1
--- ispman.listMailboxes	30 May 2004 23:35:32 -0000	1.4
+++ ispman.listMailboxes	11 Sep 2006 23:31:24 -0000	1.4.6.1
@@ -3,15 +3,23 @@
     use FindBin;
     unshift @INC,
       ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
+    use Getopt::Std;
+    getopt( 'h', \%opts );
+    unless ( $opts{'h'} ) {
+        $0 =~ s/.*\///;
+        print "Usage: $0 -h imap_server [filter]\n";
+        print "Example: $FindBin::Script -h localhost\n";
+        print "Example: $FindBin::Script -h localhost user.\*_example_com\n";
+        exit;
+    }
+
 }
 
-$|++;
-require "cyrusadmin.pm";
+require "mailbox_actions.lib";
 
-$mailboxes = $ARGV[0] || '*';
-@list = $imap->list($mailboxes);
-for (@list) {
-    s/^$mailbox_prefix//;
+my $filter = $ARGV[0] || '*';
+
+for ( list_mailboxes( $opts{'h'}, $filter ) ) {
     print "$_\n";
 }
 exit;

Index: ldifdiff
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ldifdiff,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -u -d -r1.3 -r1.3.6.1
--- ldifdiff	20 Jun 2004 14:20:50 -0000	1.3
+++ ldifdiff	11 Sep 2006 23:31:24 -0000	1.3.6.1
@@ -1,5 +1,4 @@
 #! /usr/bin/perl
-# $Id$
 
 =head1 NAME
 

Index: ispman.createMailbox
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.createMailbox,v
retrieving revision 1.5.6.1
retrieving revision 1.5.6.2
diff -u -d -r1.5.6.1 -r1.5.6.2
--- ispman.createMailbox	8 Sep 2006 13:15:38 -0000	1.5.6.1
+++ ispman.createMailbox	11 Sep 2006 23:31:24 -0000	1.5.6.2
@@ -4,44 +4,27 @@
     use FindBin;
     unshift @INC,
       ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
-    unless (@ARGV) {
+    use Getopt::Std;
+    getopt( 'h', \%opts );
+    unless ( $opts{'h'} ) {
         $0 =~ s/.*\///;
-        print "Usage: $0 -h host  mailbox [mailbox] [mailbox] .. [mailbox]\n";
+        print
+          "Usage: $0 -h imap_server mailbox [mailbox] [mailbox] ... [mailbox]\n";
         print "Example: $FindBin::Script -h localhost user_domain_tld\n";
         print "Example: $FindBin::Script -h localhost user\@domain.tld\n";
         exit;
     }
 }
-require "cyrusadmin.pm";
 
-use lib qw(%%installDir%%/lib);
+require "mailbox_actions.lib";
 
-@mailboxes = @ARGV;
+my @mailboxes = @ARGV;
+my $err       = 0;
 
 for (@mailboxes) {
-    $mailbox = join '', ( $mailbox_prefix, email2uid($_) );
-    try( $imap->create($mailbox) );
+    $err += create_mailbox( $opts{'h'}, email2uid($_) );
 }
 
-sub email2uid {
-    my $str = shift;
-    ( $uid, $domain ) = split( '@', $str );
-    if ( $ISPMan::Config->{'AllowFullEmailLogins'} ) {
-        if ( $ISPMan::Config->{'CyrusUnixHierarchySep'} ) {
-            if ($uid) {
-                $uid =~s/\./\\./g;
-            }
-        }
-        if ($domain) {
-            $domain =~ s/\./\\./g;
-            $str = join '\@', ( $uid, $domain );
-        }
-    } else {
-        if ($domain) {
-            $domain =~ s/\./_/g;
-            $str = join '_', ( $uid, $domain );
-        }
-    }
-    return $str;
-}
-exit;
+exit $err;
+
+__END__

Index: ispman.setMailboxQuota
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.setMailboxQuota,v
retrieving revision 1.4.6.1
retrieving revision 1.4.6.2
diff -u -d -r1.4.6.1 -r1.4.6.2
--- ispman.setMailboxQuota	8 Sep 2006 13:15:38 -0000	1.4.6.1
+++ ispman.setMailboxQuota	11 Sep 2006 23:31:24 -0000	1.4.6.2
@@ -3,39 +3,17 @@
     use FindBin;
     unshift @INC,
       ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
-    unless (@ARGV) {
+    use Getopt::Std;
+    getopt( 'h', \%opts );
+    unless ( $opts{'h'} ) {
         $0 =~ s/.*\///;
-        print "Usage: $0 -h host  mailbox quota\n";
+        print "Usage: $0 -h imap_server mailbox quota\n";
         exit;
     }
 }
-require "cyrusadmin.pm";
-
-sub email2uid {
-    my $str = shift;
-    ( $uid, $domain ) = split( '@', $str );
-    if ( $ISPMan::Config->{'AllowFullEmailLogins'} ) {
-        if ( $ISPMan::Config->{'CyrusUnixHierarchySep'} ) {
-            if ($uid) {
-                $uid =~s/\./\\./g;
-            }
-        }
-        if ($domain) {
-            $domain =~ s/\./\\./g;
-            $str = join '\@', ( $uid, $domain );
-        }
-    } else {
-        if ($domain) {
-            $domain =~ s/\./_/g;
-            $str = join '_', ( $uid, $domain );
-        }
-    }
-    return $str;
-}
+require "mailbox_actions.lib";
 
-$mailbox = join "", ( $mailbox_prefix, email2uid($ARGV[0]) );
-$quota = $ARGV[1];
-try( $imap->set_quota( $mailbox, $quota ) );
+my $err = set_quota( $opts{'h'}, $ARGV[0], $ARGV[1] );
 
-exit;
+exit $err;
 

Index: ispman.getMailboxQuota
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.getMailboxQuota,v
retrieving revision 1.4
retrieving revision 1.4.6.1
diff -u -d -r1.4 -r1.4.6.1
--- ispman.getMailboxQuota	30 May 2004 23:35:32 -0000	1.4
+++ ispman.getMailboxQuota	11 Sep 2006 23:31:24 -0000	1.4.6.1
@@ -5,20 +5,22 @@
     use FindBin;
     unshift @INC,
       ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
-    unless (@ARGV) {
+    use Getopt::Std;
+    getopt( 'h', \%opts );
+    unless ( $opts{'h'} ) {
         $0 =~ s/.*\///;
-        print "Usage: $0 -h host  mailbox [mailbox] [mailbox] .. [mailbox]\n";
+        print
+          "Usage: $0 -h imap_server mailbox [mailbox] [mailbox] .. [mailbox]\n";
         exit;
     }
 }
-require "cyrusadmin.pm";
+require "mailbox_actions.lib";
 
-@mailboxes = @ARGV;
+my @mailboxes = @ARGV;
 
 for (@mailboxes) {
-    $_ = "$mailbox_prefix$_";
-    try( @q = $imap->get_quota($_) );
-    print Dumper( \@q );
+    my @q = get_quota( $opts{'h'}, email2uid($_) );
+    print join( ",", @q ) . "\n";
 }
 
 exit;

--- ispman.add_vhost DELETED ---

Index: ispman.dnsshow
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.dnsshow,v
retrieving revision 1.10
retrieving revision 1.10.6.1
diff -u -d -r1.10 -r1.10.6.1
--- ispman.dnsshow	5 Jun 2004 12:45:18 -0000	1.10
+++ ispman.dnsshow	11 Sep 2006 23:31:24 -0000	1.10.6.1
@@ -10,6 +10,7 @@
         print "$0 -d domain -t type [-v] \n";
         print "  where type can be one of the following:\n";
         print "  A       List of host addresses\n";
+        print "  TXT     List of text infos\n";
         print "  NS      List of Name servers\n";
         print "  MX      List of Mail servers\n";
         print "  CNAME   List of Canonical names\n";
@@ -22,8 +23,6 @@
     }
 }
 
-use lib qw(%%installDir%%/lib);
-
 use ISPMan;
 use CGI;
 use vars qw($ispman);
@@ -73,6 +72,10 @@
 
 B<ispman.dnsshow -d ispman.org -t A >
 
+To see TXT records for domain ispman.org
+
+B<ispman.dnsshow -d ispman.org -t TXT >
+
 To see NS records for domain ispman.org
 
 B<ispman.dnsshow -d ispman.org -t NS>

Index: ispman.deleteMailbox
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.deleteMailbox,v
retrieving revision 1.4
retrieving revision 1.4.6.1
diff -u -d -r1.4 -r1.4.6.1
--- ispman.deleteMailbox	30 May 2004 23:35:31 -0000	1.4
+++ ispman.deleteMailbox	11 Sep 2006 23:31:24 -0000	1.4.6.1
@@ -1,27 +1,29 @@
 #!/usr/bin/perl
-use lib qw(%%installDir%%/lib);
 
 BEGIN {
     use FindBin;
     unshift @INC,
       ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
-    unless (@ARGV) {
+    use Getopt::Std;
+    getopt( 'h', \%opts );
+    unless ( $opts{'h'} ) {
         $0 =~ s/.*\///;
-        print "Usage: $0 -h host  mailbox [mailbox] [mailbox] .. [mailbox]\n";
+        print
+          "Usage: $0 -h imap_server mailbox [mailbox] [mailbox] .. [mailbox]\n";
         exit;
     }
 }
 
-require "cyrusadmin.pm";
-@mailboxes = @ARGV;
+require "mailbox_actions.lib";
 
-for $mailbox (@mailboxes) {
-    $mailbox = "$mailbox_prefix$mailbox";
-    try( $imap->set_acl( $mailbox, $admin, "lrswipdca" ) );
-    try( $imap->delete($mailbox) );
+my @mailboxes = @ARGV;
+my $err       = 0;
+
+for (@mailboxes) {
+    $err += delete_mailbox( $opts{'h'}, email2uid($_) );
 }
 
-exit;
+exit $err;
 
 __END__
 

Index: ispman-agent
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman-agent,v
retrieving revision 1.69
retrieving revision 1.69.2.1
diff -u -d -r1.69 -r1.69.2.1
--- ispman-agent	9 Oct 2005 09:27:54 -0000	1.69
+++ ispman-agent	11 Sep 2006 23:31:24 -0000	1.69.2.1
@@ -27,7 +27,7 @@
 @ISA     = qw(Exporter AutoLoader);
 @EXPORT  = qw();
 $VERSION = '0.01';
-$VERBOSE=1;
+$VERBOSE = 1;
 
 use Data::Dumper;
 use File::Path;
@@ -120,18 +120,18 @@
 }
 
 sub init_log {
-    require Log::Agent::Driver::File;  # logging made to file
-    logconfig(-driver =>
-              Log::Agent::Driver::File->make(
-                                             -prefix      => $name,
-                                             -showpid     => $pid,
-                                             -channels    => {
-                                                 'error'  => "$log_file",
-                                                 'output' => "$log_file",
-                                                 'debug'  => "$log_file",
-                                             },
-                                             )
-              );
+    require Log::Agent::Driver::File;    # logging made to file
+    logconfig(
+        -driver => Log::Agent::Driver::File->make(
+            -prefix   => $name,
+            -showpid  => $pid,
+            -channels => {
+                'error'  => "$log_file",
+                'output' => "$log_file",
+                'debug'  => "$log_file",
+            },
+        )
+    );
 
 }
 
@@ -159,8 +159,8 @@
 
 $ispman = ISPMan->new();
 
-$agentFrequency      = $ispman->getConf("agentFrequency") || 1;
-$ldapBaseDN          = $ispman->getConf('ldapBaseDN');
+$agentFrequency = $ispman->getConf("agentFrequency") || 1;
+$ldapBaseDN     = $ispman->getConf('ldapBaseDN');
 
 # get all host aliases
 my $hostInfo = $ispman->getHostInfo($hostname);
@@ -212,19 +212,20 @@
         {
             for $params ( keys %{ $processHash->{$domain}{$job} } ) {
                 logsay("Doing $job on $domain with parameters $params");
+
                 # Make a hash from params
-                my @pairs=();
-                my $pair="";
-                my $pname="";
-                my $pval="";
-                my $phash={};
+                my @pairs = ();
+                my $pair  = "";
+                my $pname = "";
+                my $pval  = "";
+                my $phash = {};
 
-                @pairs=split('&', $params);
-                for $pair(@pairs) {
-                   ($pname, $pval)=split(/\s*=\s*/, $pair);
-                   $phash->{$pname}=$pval;
+                @pairs = split( '&', $params );
+                for $pair (@pairs) {
+                    ( $pname, $pval ) = split( /\s*=\s*/, $pair );
+                    $phash->{$pname} = $pval;
                 }
-                $phash->{'domain'}=$domain;
+                $phash->{'domain'} = $domain;
                 $message = &{$job}($phash);
                 if ( $message == 1 ) {
                     $ispman->deleteProcesses(
@@ -236,7 +237,6 @@
                         "error", $message );
                 }
 
-
             }
         }
     }
@@ -252,73 +252,71 @@
 
 }
 
+## function called by the task scripts
+sub executeCommands {
+    $NOEXEC = 0;
+    my @commands = @_;
+    my $errs     = 0;
+    foreach $command (@commands) {
+        my $rc = -1;
 
+        unless ($NOEXEC) {
+            $rc = system($command);
+        }
+        logsay( "Command=\"$command\", rc=" . $rc );
 
+        $errs += ( $rc != 0 );
 
-## function called by the task scripts
-sub executeCommands{
-    $NOEXEC=0;
-    my @commands=@_;
-    foreach $command(@commands) {
-        if ($VERBOSE) {
-            print "Command: $command\n";
-        }
-        unless ($NOEXEC){
-            system($command);
-        }
     }
+    return $errs;
 }
 
-
-
-
 sub AUTOLOAD {
-    my $self=shift;
+    my $self = shift;
     my $type = ref($self);
     my $params;
     my $retVal;
 
-
-
-    if ($type eq "HASH") {
-       $params=$self;
-    } else {
-       $params=shift;
+    if ( $type eq "HASH" ) {
+        $params = $self;
+    }
+    else {
+        $params = shift;
     }
 
+    our @cmd = ();
 
-    our @cmd=();
-
-
-    my $name=$AUTOLOAD;
-    $name =~ s/.*://;   # strip fully-qualified portion
-    $text="You tried to call $name with ";
-    $text.=join ",", map{"$_=$params->{$_}"} keys %$params;
-    $text.="\n";
-
-    $task_func=join "_", ($name, "task");
-    $task_dir=$FindBin::Bin . "/../tasks/";
-    $task_file="$task_dir/$task_func\.pl";
+    my $name = $AUTOLOAD;
+    $name =~ s/.*://;    # strip fully-qualified portion
+    $text = "You tried to call $name with ";
+    $text .= join ",", map { "$_=$params->{$_}" } keys %$params;
+    $text .= "\n";
 
+    $task_func = join "_", ( $name, "task" );
+    $task_dir  = $FindBin::Bin . "/../tasks/";
+    $task_file = "$task_dir/$task_func\.pl";
 
-    $text.="Task dir: $task_dir does not exists" unless (-d $task_dir);
-    $text.="Task file: $task_file does not exists" unless (-e $task_file);
+    $text .= "Task dir: $task_dir does not exists"   unless ( -d $task_dir );
+    $text .= "Task file: $task_file does not exists" unless ( -e $task_file );
 
-    if (-f $task_file) {
-       do $task_file;
-       $retVal=&{$task_func}($params);
-    } else {
-       print $text;
+    if ( -f $task_file ) {
+        do $task_file;
+        $retVal = &{$task_func}($params);
     }
-    if ($retVal==0) {
-       return 0;
-    } else {
-       executeCommands(@cmd);
-       return 1;
+    else {
+        print $text;
+    }
+    if ( $retVal == 0 ) {
+        return $text;
     }
 
-
-
+    my $errs = executeCommands(@cmd);
+    if ( $errs == 0 ) {
+        return 1;
+    }
+    else {
+        return "There were $errs errors on\n" . join( "\n", @cmd );
+    }
 }
 
 sub DESTROY {

Index: ispman.dnsset
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.dnsset,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- ispman.dnsset	6 Jun 2006 22:15:31 -0000	1.15
+++ ispman.dnsset	11 Sep 2006 23:31:24 -0000	1.15.2.1
@@ -77,6 +77,9 @@
 
 ispman.dnsset -d domainname -t A [-p] hostname ipaddress
 
+=head2 A addresses
+
+ispman.dnsset -d domainname -t TXT hostname text
 
 =head2 NS addresses
 
@@ -97,10 +100,6 @@
 
 
 
-
-
-
-
 =head1 Examples
 
 To set a SOA record for domain example.com
@@ -113,6 +112,10 @@
 
 B<ispman.dnsset -d example.com -t A www 192.168.1.1>
 
+To set a SPF description for host mail for domain example.com
+
+B<ispman.dnsset -d example.com -t TXT mail "v=spf1 a mx">
+
 To set ns1.example.com as nameserver for domain example.com
 
 B<ispman.dnsset -d example.com -t NS @ ns1.example.com>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.