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: //scripts.20110531.215904.25158/synctransfers
#!/usr/bin/perl
# cpanel - synctransfers                          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 strict;
use warnings;
use Cpanel::Update          ();
use Cpanel::Config::Sources ();
use Cpanel::SafeDir         ();
use Cpanel::SafeRun         ();

my $tree           = 'transfers_';
my $sync_dir       = 'transfers';
my $base           = '/usr/local/cpanel/Whostmgr/Pkgacct/';
my %CPSRC          = Cpanel::Config::Sources::loadcpsources();
my $updateconf_ref = Cpanel::Update::loadupdateconfig();

if ( !-e $base ) {
    Cpanel::SafeDir::safemkdir($base) or die "Unable to create directory: $!";
}

if ( !exists $updateconf_ref->{'CPANEL'} || !$updateconf_ref->{'CPANEL'} ) {
    $tree .= 'RELEASE';
}
elsif ( $updateconf_ref->{'CPANEL'} eq 'stable' || $updateconf_ref->{'CPANEL'} eq 'manual' ) {
    $tree .= 'STABLE';
}
elsif ( $updateconf_ref->{'CPANEL'} =~ m/(nightly|demo)/i ) {
    $tree .= 'NIGHTLY';
}
elsif ( $updateconf_ref->{'CPANEL'} eq 'manual-edge' || $updateconf_ref->{'CPANEL'} eq 'edge' ) {
    $tree .= 'EDGE';
}
elsif ( $updateconf_ref->{'CPANEL'} eq 'manual-current' || $updateconf_ref->{'CPANEL'} eq 'current' ) {
    $tree .= 'CURRENT';
}
elsif ( $updateconf_ref->{'CPANEL'} eq 'manual-beta' || $updateconf_ref->{'CPANEL'} eq 'beta' ) {
    $tree .= 'BETA';
}
else {
    $tree .= 'RELEASE';
}

if ( -x '/scripts/cpanelsync' ) {
    print "Sync transfer scripts...\n";
    if ( my $pid = fork() ) {
        while ( waitpid( $pid, 1 ) != -1 ) {

            # wait...
        }
    }
    else {
        system( '/scripts/cpanelsync', $CPSRC{'HTTPUPDATE'}, "/cpanelsync/$tree/pkgacct", $base );
        exit;
    }
}

if ( -d '/usr/local/cpanel/Whostmgr/pkgacct' ) {
    Cpanel::SafeRun::saferun( 'rm', '-rf', '/usr/local/cpanel/Whostmgr/pkgacct' );
}

print "Done.\n";