Apache-Logmonster
view release on metacpan or search on metacpan
lib/Apache/Logmonster/Utility.pm view on Meta::CPAN
);
my $pass = $p{password};
my $default = $p{default};
if ( ! $self->is_interactive() ) {
$log->audit( "not running interactively, can not prompt!");
return $default;
}
return $log->error( "ask called with \'$question\' which looks unsafe." )
if $question !~ m{\A \p{Any}* \z}xms;
my $response;
return $p{test_ok} if defined $p{test_ok};
PROMPT:
print "Please enter $question";
print " [$default]" if ( $default && !$pass );
print ": ";
lib/Apache/Logmonster/Utility.pm view on Meta::CPAN
$log->audit( "sources_get: fetching $site$path/$tarball");
$self->get_url( "$site$path/$tarball", fatal => 0)
or return $log->error( "couldn't fetch $site$path/$tarball", %args);
next if ! -e $tarball;
$log->audit( " sources_get: testing $tarball ");
if (`$filet $tarball | $grep zip`) {
$log->audit( " sources_get: looks good!");
return 1;
};
$log->audit( " oops, is not [b|g]zipped data!");
$self->file_delete( $tarball, %args);
}
return $log->error( "unable to get $package", %args );
}
lib/Apache/Logmonster/Utility.pm view on Meta::CPAN
Checks the ownership on all home directories to see if they are owned by their respective users in /etc/password. Offers to repair the permissions on incorrectly owned directories. This is useful when someone that knows better does something like "ch...
######### check_homedir_ownership ############
# Usage : $util->check_homedir_ownership();
# Purpose : repair user homedir ownership
# Returns : 0 - failure, 1 - success
# Parameters :
# Optional : I - auto - no prompts, just fix everything
# See Also : sysadmin
Comments: Auto mode should be run with great caution. Run it first to see the results and then, if everything looks good, run in auto mode to do the actual repairs.
=item chown_system
The advantage this sub has over a Pure Perl implementation is that it can utilize sudo to gain elevated permissions that we might not otherwise have.
############### chown_system #################
# Usage : $util->chown_system( dir=>"/tmp/example", user=>'matt' );
# Purpose : change the ownership of a file or directory
( run in 0.296 second using v1.01-cache-2.11-cpan-64827b87656 )