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/proc/self/root/scripts.20110531.215904.25158/cpanelsync_postprocessor
#!/usr/bin/perl
# cpanel - cpanelsync_postprocessor               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 Cpanel::FSOptimize ();
use Cpanel::LoadFile   ();

my $saferoot = $ARGV[0];

if ($saferoot =~ /^\/usr\/local\/cpanel$/) {
   if (-e $saferoot . '/.cpanelsync.new' && -s _) {
    my $newfiles = Cpanel::LoadFile::loadfile($saferoot . '/.cpanelsync.new');
    my @OPT = ();
    if ($newfiles =~ /Cpanel/) { push @OPT, '/usr/local/cpanel/Cpanel'; }
    if ($newfiles =~ /unprotected/) { push @OPT, '/usr/local/cpanel/base/unprotected'; }
    if ($newfiles =~ /yui/) { push @OPT, '/usr/local/cpanel/base/yui'; }
    if ($newfiles =~ /cjt/) { push @OPT, '/usr/local/cpanel/base/cjt'; }

	_chattr(@OPT) if (@OPT);
   }
}
if ($saferoot =~ /^\/(?:scripts|usr\/local\/cpanel\/bin|usr\/local\/cpanel\/bin)$/) {
   if (-e $saferoot . '/.cpanelsync.new' && -s _) {
	_chattr($saferoot);
   }
}
elsif ($saferoot =~ /^\/usr\/local\/cpanel\/base\/frontend/) {
   if (-e $saferoot . '/.cpanelsync.new' && -s _) {

	_chattr($saferoot);
   }
}

sub _chattr {
    my @dirs = @_;
    if (! Cpanel::FSOptimize::has_chattr()) {
        return;
    }
    my $chattr_bin  = Cpanel::FSOptimize::get_chattr_bin();
    if (!$chattr_bin) {exit; }
    print "Optimizing File Access in " . join(',',@dirs) . "....";
    system 'chattr','-R','+A',@dirs;
    print "Done\n";
}