File: //proc/self/root/proc/self/root/scripts.20110531.215904.25158/getrpmfor
#!/usr/bin/perl
# cpanel - getrpmfor 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, '/scripts', '/usr/local/cpanel'; }
$| = 1;
use cPanelRPM;
use Cpanel::OSSys;
my ( $system, $release, $machine ) = ( Cpanel::OSSys::uname() )[ 0, 2, 4 ];
$rpm = cPanelRPM->new;
if ( $ARGV[0] eq "--install" ) {
shift(@ARGV);
$install = 1;
}
if ( $0 =~ /getrpmfor/i ) {
$install = 1;
}
$item = $rpm->whatprovides( $ARGV[0] );
print "${item}\n";
if ( $install && $item ne "" ) {
$rpm->install($item);
}
sub safeaprestart {
if ( -x "/usr/local/cpanel/bin/safeapacherestart" ) {
system("/usr/local/cpanel/bin/safeapacherestart");
}
else {
if ( -x "/usr/bin/killall" ) {
system( "/usr/bin/killall", "-USR1", "httpd" );
}
elsif ( -x "/usr/sbin/killall" ) {
system( "/usr/sbin/killall", "-USR1", "httpd" );
}
elsif ( -x "/sbin/killall" ) {
system( "/sbin/killall", "-USR1", "httpd" );
}
elsif ( -x "/bin/killall" ) {
system( "/bin/killall", "-USR1", "httpd" );
}
elsif ( -x "/usr/local/bin/killall" ) {
system( "/usr/local/bin/killall", "-USR1", "httpd" );
}
elsif ( -x "/usr/local/sbin/killall" ) {
system( "/usr/local/sbin/killall", "-USR1", "httpd" );
}
}
}