MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //proc/self/root/scripts.20110531.215904.25158/sa-update_wrapper
#!/usr/bin/perl
# cpanel - sa-update_wrapper                      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'; }

alarm(3600);

use Cpanel::FindBin         ();
use Cpanel::SafeRun::Errors ();

my $saupdate = Cpanel::FindBin::findbin('sa-update');

if ( !$saupdate || !-e $saupdate || !-x $saupdate ) {
    die "$app: sa-update is missing!\n";
}

sub run_saupdate {
    my $gpg_option = shift;
    if ( !$gpg_option ) {
        my $gpg_bin = Cpanel::FindBin::findbin('gpg');
        $gpg_option = ( !$gpg_bin || !-x $gpg_bin ) ? '--nogpg' : '--gpg';
    }
    print "Running sa-update ($saupdate).....";
    system( $saupdate, $gpg_option, grep( /-Q/i, @ARGV ) ? () : ('-D') );
    print "Done\n";
}

run_saupdate();

print "Checking update....";
my $spamassassin_bin = Cpanel::FindBin::findbin( 'spamassassin', 'path' => [ '/usr/sbin', '/usr/local/sbin', '/usr/bin', '/usr/local/bin' ] );
my $has_rules = 1;
if ( -x $spamassassin_bin ) {
    my @testout = Cpanel::SafeRun::Errors::saferunallerrors( $spamassassin_bin, '--lint', '-D' );
    if ( grep ( /no rules were found/, @testout ) ) {
        $has_rules = 0;
    }
}

if ( !$has_rules ) {
    print "update failed...retrying without gpg...\n";
    run_saupdate('--nogpg');
} else {
    print "update ok!\n";
}