bulletproftlink shell
bulletproftlink shell


Server : Apache
System : Linux copper.netcy.com 2.6.32-754.27.1.el6.centos.plus.x86_64 #1 SMP Thu Jan 30 13:54:25 UTC 2020 x86_64
User : montcaro ( 581)
PHP Version : 7.4.28
Disable Function : NONE
Directory :  /scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 


Create directory:
Current File : //scripts/cpanelsync_postprocessor
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - cpanelsync_postprocessor                  Copyright 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

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";
}

Spamworldpro BIBIL Mini