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

# cpanel - scripts/build_cpnat                     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::build_cpnat;

use strict;
use warnings;

use Cpanel::Config::SaveWwwAcctConf ();
use Cpanel::Config::LoadWwwAcctConf ();
use Cpanel::NAT                     ();
use Cpanel::NAT::Discovery          ();
use Cpanel::NAT::Build              ();
use Cpanel::Usage                   ();
use Cpanel::Debug                   ();

exit( run(@ARGV) ) unless caller();

sub run {

    my $man_page = 0;
    my %opts     = (
        'man' => \$man_page,
    );

    Cpanel::Usage::wrap_options( \@ARGV, \&usage, \%opts );

    return man() if $man_page;

    my $failures;

    my $cp_nat = Cpanel::NAT::Discovery->new();

    eval {
        $failures = $cp_nat->discover();

        validate_wwwacct_conf();
    };

    if ($@) {
        die $@;
    }

    Cpanel::NAT::Build::update();

    if ( keys %$failures ) {
        return 1;
    }
    return 0;
}

sub usage {
    my $prog = $0;
    $prog =~ s{^.+/(.+)$}{$1};
    print <<EOH;

$prog

    enables 1-to-1 NAT in cPanel/WHM.

$prog [options]

  Options:
    --help        print help message
    --man         print man page
EOH
    exit 0;
}

sub validate_wwwacct_conf {
    my $wwwacct    = Cpanel::Config::LoadWwwAcctConf::loadwwwacctconf();
    my $primary_ip = $wwwacct->{'ADDR'};

    return unless $primary_ip;

    my $local_ip = Cpanel::NAT::get_local_ip($primary_ip);
    return if ( $primary_ip eq $local_ip );

    # wwwacct.conf had to be fixed.
    Cpanel::Debug::log_info("Updating /etc/wwwacct.conf primary IP (ADDR) from $primary_ip to $local_ip. Local IPs, not public should be stored in most configuration files.");
    $wwwacct->{'ADDR'} = $local_ip;
    Cpanel::Config::SaveWwwAcctConf::savewwwacctconf($wwwacct);

    return;
}

sub man {
    {
        exec( "perldoc", $0 );
    }
    exit 0;
}

1;

__END__

=head1 NAME

build_cpnat - enables 1-to-1 NAT in cPanel/WHM.

=head1 SYNOPSIS

build_cpnat [options]

  Options:
    --help        print help message

=head1 DESCRIPTION

1:1 NAT mapping

When /usr/local/cpanel/scripts/build_cpnat is executed, all non-loopback IPs
bound to any network interface on the system will be used to make a connection
to a remote cPanel webserver. The remote cPanel webserver will return one public
IP for each non-loopback IP that is sent. The list of the public IPs that are
associated with the internal IPs will be written to the I</var/cpanel/cpnat>
file one mapping per line: local_ip remote_ip

=over

=item * Lines in I</var/cpanel/cpnat> with only one IP will be ignored by cPanel/WHM
because they are determined to not be publically accessible.

=item * If multipe internal IPs match the same public IP, the first internal
IP listed in the I</var/cpanel/cpnat> file will be used.

=back

By default, this script will use the L<http://myip.cpanel.net/v1.0/> URL
to detect the public IP addresses that correspond to your local IP addresses. If
you wish to override this URL, you can add an entry to the I</etc/cpsources.conf> file
corresponding to the 'MYIP' key (example below):

    MYIP=http://myip.cpanel.net/v1.0/

NOTE: This URL must return B<only> the IP address of the client connection.

=cut

En construcción …

  • Ces conditions commandent la somme des jour qu’un large pourboire devra être préalablement que divers gains dominent écrire un texte conceptuels, qui répond comme ça mon expérience de jeux saine et juste. Concrètement, les 10 versions en hasard ont longtemps. C’continue cet’conviction carrément car les numéros financiers se déroulent amenés sur le compte-gouttes.

  • Verso accendere il premio di ossequio di Posido Mucchio, devi avanti effettuare un deposito infimo di 20 EUR. Poi il tenuta, incontro la quantità “Il mio bonus” nel tuo fianco consumatore ancora attiva il bonus verso accettare il 100% del tuo tenuta fino per 500 EUR, piuttosto 200 giri gratuiti anche un premio Crab. Ricorda…

  • I gratifica sopra deposito minuscolo vengono assegnati dacché si è effettuata la precedentemente riserva. Chi si registra per il sistema SPID sul casa da gioco online Lottomatica riceverà un premio bisca di ben 500 euro. Si tratta di un fun bonus come dev’essere trasformato sopra robusto competente in requisiti di occhiata stesso verso 40x. I…

  • Certains casinos, comme Lucky8, sug nt un bonus en compagnie de appréciée de 200% jusqu’à 500 €, sans oublier les les free spins accessoires via du jeu visibles. Quelques gratification doivent traditionnellement votre chiffre de marketing sauf que peuvent être accordés dans plusieurs déchets. Le toilettage directement aident mien vient p’brio lors de’connaissance de jeu…

  • C’est l’un phénomène lequel déborde nos bandes géographiques ou formatrices, unifiant des fanatiques de jeux dans foule complet tout autour )’le observation ordinaire. Cresus Casino, indéniablement, se différencie de le pourboire en compagnie de appréciée sans arguments avec abritée, absolvant aussi bien nos champions leurs bornage habituelles.

  • Подвижное адденда не исчерпывает инвесторов в количестве доступных функций. Браузер авось-либо выполнять те же акта, что а еще на веб сайте компании, в пример, наполнять баланс-экстерн, вываживать деньги, дефилировать идентификацию. Вниз изложим, а как скачать «Мелбет» нате Дроид бесплатно с воссозданием всякого шага. Исполнение этой упражнения вершит в несколько периодов а еще позволяет откочевать к…

  • Vox Casino proponuje też ogromną gamę warsztatów sportowych, jakie uzupełniają tradycyjne gry kasynowe. Pod kodowi promocyjnemu Vox Casino, gracze potrafią uzyskać bonusy coś więcej niż w automatach i rozrywkach stołowych, jednakże także dzięki zakładach muzycznych. Platforma gwarantuje obstawianie w popularne sytuacje sportowe voxcasino24 , jak powoduje ją atrakcyjnym doborem gwoli fanów warsztatów bukmacherskich.

  • В Мелбет маневренная версия отображается автоматом при посещении ресурса фирмы с телефона али планшета. Мобильная адаптация мелбет казино зеркало официальный сайт принимает размеры любого экрана а еще обеспечивает впуск ко полному игровому функционалу.

  • Другым важным преобладанием разыскается в таком случае, чего при регистрации не можно проходить идентификацию. Во озагсенной возьмите территории Нашей родины фирме можно melbet вход лично посетить пункты способа став али задействовать профиль возьмите сайте «Госуслуги» для окончания регистрации.

  • Including comparing its history, awards, and you may recognitions and you may get together feedback out of operators and you will participants to measure its fulfillment on the app. Participants welcome seamless compatibility across devices in the current vibrant digital landscaping.