MOON
Server: Apache
System: Linux vps.thepromohut.com 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686
User: caretrak (507)
PHP: 5.2.10
Disabled: NONE
Upload Files
File: //scripts.20110601.041516.15411/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" );
        }
    }
}