App-Unix-RPasswd

 view release on metacpan or  search on metacpan

inc/Module/Install/Fetch.pm  view on Meta::CPAN


    require Cwd;
    my $dir = Cwd::getcwd();
    chdir $args{local_dir} or return if exists $args{local_dir};

    if (eval { require LWP::Simple; 1 }) {
        LWP::Simple::mirror($args{url}, $file);
    }
    elsif (eval { require Net::FTP; 1 }) { eval {
        # use Net::FTP to get past firewall
        my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
        $ftp->login("anonymous", 'anonymous@example.com');
        $ftp->cwd($path);
        $ftp->binary;
        $ftp->get($file) or (warn("$!\n"), return);
        $ftp->quit;
    } }
    elsif (my $ftp = $self->can_run('ftp')) { eval {
        # no Net::FTP, fallback to ftp.exe
        require FileHandle;
        my $fh = FileHandle->new;

lib/App/Unix/RPasswd.pm  view on Meta::CPAN

                my $msg =
                  ( $self->args->{debug} )
                  ? 'Running on ' 
                  . $server
                  . ' with password \''
                  . $self->args->{password} . '\'...'
                  : "Running on $server...";
                say $msg;
                my $status = eval {
                    local $SIG{ALRM} = sub {
                        say "Timeout exceeded for $server.";
                        die "Timeout exceeded\n";    # NB: \n required
                    };
                    alarm $self->args->{timeout};
                    return $self->_connection_obj->run(
                        $server,
                        $self->args->{password},
                        $self->args->{debug}
                    );
                    alarm 0;
                };
                if ( !$status ) { $error = $server; }

lib/App/Unix/RPasswd.pm  view on Meta::CPAN


This optional parameterre sets the reruns for failed targets (defaults to 0).

=head2 sessions | s

This optional parameter sets the simultaneous sessions (defaults to 5).

=head2 timeout | t

This optional parameter sets the session timeout in seconds (defaults to 20 
seconds). While OpenSSH has the ConnectTimeout (passed as --ssh_args "-OConnectTimeout=<value>")
that provides a similar funcionality, its for on Solaris, SunSSH, has not. This
is a generic implementation that work on both ssh families.

=head2 debug

This parameter prints debug output.

=head2 help | h

This parameter prints this help screen.

script/rpasswd  view on Meta::CPAN


This optional parameterre sets the reruns for failed targets (defaults to 0).

=head2 sessions | s

This optional parameter sets the simultaneous sessions (defaults to 5).

=head2 timeout | t

This optional parameter sets the session timeout in seconds (defaults to 20 
seconds). While OpenSSH has the ConnectTimeout (passed as --ssh_args "-OConnectTimeout=<value>")
that provides a similar funcionality, its for on Solaris, SunSSH, has not. This
is a generic implementation that work on both ssh families.

=head2 debug

This parameter prints debug output.

=head2 help | h

This parameter prints this help screen.



( run in 0.252 second using v1.01-cache-2.11-cpan-4d50c553e7e )