Net-FullAuto
view release on metacpan or search on metacpan
lib/Net/FullAuto/FA_Core.pm view on Meta::CPAN
unless (exists $cache->{'key'} && $cache->{'key'}) {
if ($cache_key) {
$cache->{'key'}=$cache_key;
} else {
handle_error("A cache object exists, ".
"but a cache key is not defined");
}
}
} elsif ((-1==index $caller,'mirror') &&
(-1==index $caller,'login_retry')) {
my $time_out='$' . (caller)[0] . '::timeout';
$time_out= eval $time_out;
if ($@ || $time_out!~/^[1-9]+/) {
$timeout=30;
} else { $timeout=$time_out }
} else { print "FOUR\n";$timeout=30 }
if (defined $_[2] && lc($_[2]) ne '__telnet__' && lc($_[2]) ne '__ftp__') {
$Net::FullAuto::FA_Core::test=$_[2];
} elsif (defined $_[2] && (-1<index $_[2],'Cache::FileCache')) {
$cache=$_[2];
unless (exists $cache->{'key'} && $cache->{'key'}) {
lib/Net/FullAuto/FA_Core.pm view on Meta::CPAN
$cache=$_[2];
unless (exists $cache->{'key'} && $cache->{'key'}) {
if ($cache_key) {
$cache->{'key'}=$cache_key;
} else {
handle_error("A cache object exists, ".
"but a cache key is not defined");
}
}
} else {
my $tst='$' . (caller)[0] . '::test';
$tst= eval $tst;
$tst||=0;
if ($@ || $tst!~/^[1-9]+/) {
$Net::FullAuto::FA_Core::test=0;
} else { $Net::FullAuto::FA_Core::test=$tst }
}
if (!$cache && $main::cache) {
$cache=$main::cache;
}
unless (exists $Hosts{$hostlabel}) {
lib/Net/FullAuto/FA_Core.pm view on Meta::CPAN
return $dbenv,$bdb;
}
sub fa_login
{
if (defined $_[0] && $_[0]=~/^\d+$/) {
$timeout=$_[0];
} else {
my $time_out='$' . (caller)[0] . '::timeout';
$time_out= eval $time_out;
$time_out||=30;
if ($@ || $time_out!~/^[1-9]+/) {
$timeout=30;
} else { $timeout=$time_out }
} $test=0;$prod=0;
###################################
# The following are being set if
# found defined in Term::Menus
my $log_='$' . (caller)[0] . '::log';
$log_= eval $log_;
$log_=0 if $@ || !$log_;
my $tosspass_='$' . (caller)[0] . '::tosspass';
$tosspass_= eval $tosspass_;
$tosspass_=0 if $@ || !$tosspass_;
## end Term::Menus defs ###########
my $fhtimeout='X';
my $fatimeout=$timeout;
my $tst='$' . (caller)[0] . '::test';
$tst=eval $tst;
$test=$tst if !$@ || $tst=~/^[1-9]+/;
my $_connect='connect_ssh_telnet';
if (exists $Hosts{"__Master_${$}__"}{'Local'}) {
my $loc=$Hosts{"__Master_${$}__"}{'Local'};
unless ($loc eq 'connect_ssh'
|| $loc eq 'connect_telnet'
|| $loc eq 'connect_ssh_telnet'
|| $loc eq 'connect_telnet_ssh') {
my $die="\n FATAL ERROR - \"Local\" has "
lib/Net/FullAuto/FA_Core.pm view on Meta::CPAN
$_connect=$loc;
@RCM_Link=('ssh','telnet');
} else {
$_connect=$loc;
@RCM_Link=('telnet','ssh');
}
} else {
@RCM_Link=('ssh','telnet');
$Hosts{"__Master_${$}__"}{'Local'}=$_connect;
}
$email_defaults='%' . (caller)[0] . '::email_defaults';
%email_defaults=eval $email_defaults;
if ($@) {
$email_defaults=0;
%email_defaults=();
} else { $email_defaults=1 }
my $email_addresses='%' . (caller)[0] . '::email_addresses';
%email_addresses=eval $email_addresses;
%email_addresses=() if $@;
my $test_caller=(caller)[0];
$custom_code_module_file='$' . (caller)[0] . '::fa_code';
$custom_code_module_file=eval $custom_code_module_file;
if ($@) {
my $die="Cannot Locate the \"FullAuto Custom Code\" "
."perl module (.pm) file\n < original "
."default name 'fa_code.pm' >\n\n $@";
&handle_error($die,'-3');
}
my $man=0;my $help=0;my $userflag=0;my $passerror=0;
my $test_arg=0;my $oldcipher='';
my @holdARGV=@ARGV;@menu_args=();my $username_from='';
lib/Net/FullAuto/FA_Core.pm view on Meta::CPAN
if ($_[3] eq '__random__') {
$random=1;
} elsif ($_[1] eq '__dots__') {
$dots=1;
} elsif ($_[1] eq '__dot__') {
$dot=1;
} elsif ($_[1] eq '__dotdot__') {
$dotdot=1;
}
}
my $caller=(caller)[2];
my $hostlabel=$self->{_hostlabel}->[0];
my ($ip,$hostname,$use,$ms_share,$ms_domain,
$cmd_cnct,$ftr_cnct,$login_id,$su_id,$chmod,
$owner,$group,$sdtimeout,$transfer_dir,$uname,
$ping,$password,$proxy,$identityfile,$spawn,
$local_pw,$noretry)
=&Net::FullAuto::FA_Core::lookup_hostinfo_from_label($hostlabel,'');
my $host= ($use eq 'ip') ? $ip : $hostname;
$ms_share||='';my %output=();my $nt5=0;
my $output='';my $stderr='';my $i=0;my @output=();
lib/Net/FullAuto/FA_Core.pm view on Meta::CPAN
if (!exists $args{Cache} || !$args{Cache} && $main::cache) {
$args{Cache}=$main::cache;
}
$args{Cache}||='';
my $cache=$args{Cache};
print "WHAT IS CACHE=$cache\n" if $cache;
print "KEYS=",(join " | ",keys %{$cache}),"\n" if $cache;
#print $Net::FullAuto::FA_Core::LOG "CACHEEEEEEEEEEEEEEEEEEEEEEEEEE=",$cache->{'key'},"\n";
($caller,$cline)=(caller)[1,2];
if (ref $args{DestHost} eq 'ARRAY') {
@dhostlabels=@{$args{DestHost}};
} elsif (4<length $args{DestHost} && unpack('a5',$args{DestHost})
eq 'ARRAY') {
&Net::FullAuto::FA_Core::handle_error(
"quotes improperly surround destination hostlabel(s) arg");
} else { @dhostlabels=();push @dhostlabels, $args{DestHost} }
foreach my $dest_hlabel (@dhostlabels) {
unless (exists $Net::FullAuto::FA_Core::Hosts{$dest_hlabel}) {
my $die="The \"DestHost =>\" Argument to &mirror()"
( run in 1.087 second using v1.01-cache-2.11-cpan-1e74a51a04c )