File: //proc/self/root/scripts.20110531.215904.25158/autorepair
#!/usr/bin/perl
# cpanel - autorepair Copyright(c) 2010 cPanel, Inc.
# All rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
BEGIN { unshift @INC, '/usr/local/cpanel'; }
use Cpanel::HttpRequest ();
use Cpanel::Errors ();
$| = 1;
my $script = 'autorepair';
if ( $ARGV[0] ) {
$script = $ARGV[0];
}
$script =~ s/\///g;
my $httpClient = Cpanel::HttpRequest->new( 'hideOutput' => 1 );
print "Requesting script ... ";
my $autofix = $httpClient->request(
'host' => 'httpupdate.cpanel.net',
'url' => '/autofixer2/' . $script,
'protocol' => 0,
);
if ( $autofix eq '' ) {
Cpanel::Errors::deaderror("Problem downloading script $script! Please verify the script's name.");
}
print "Done\n";
print "Auto Repair is running...";
my $perlpid = open( PERL, "|/usr/bin/perl" );
print PERL $autofix;
close(PERL);
waitpid( $perlpid, 1 );
print "...Auto Repair is done.\n";