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

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

BEGIN {
    pop(@INC) if ( $INC[$#INC] eq '.' );
}

$| = 1;

use strict;
use Cpanel::DnsUtils::Sync ();
use Cpanel::Usage          ();

if ( !@ARGV ) {
    show_usage();
}
Cpanel::Usage::usage( \@ARGV, \&show_usage );

if ( !-e '/var/cpanel/useclusteringdns' ) {
    print STDERR "DNS Clustering is not enabled\n";
    exit 1;
}

my $action    = $ARGV[0];
my $full_sync = ( grep( /^\-?-f/i, @ARGV ) ? 1 : 0 );

if ( $action eq 'synczonelocal' ) {
    my $zone = $ARGV[1];
    if ( !$zone ) {
        show_usage();
    }
    synczonelocal($zone);
}
elsif ( $action eq 'synczone' ) {
    my $zone = $ARGV[1];
    if ( !$zone ) {
        show_usage();
    }
    synczone($zone);
}
elsif ( $action eq 'syncall' ) {
    syncall($full_sync);
}
elsif ( $action eq 'syncalllocal' || $action eq 'synclocal' ) {
    syncalllocal($full_sync);
}
else {
    show_usage();
    exit 1;
}

sub synczone {
    my $domain = shift;
    print "Syncing $domain to all machines in cluster...";
    my ( $response, $err ) = Cpanel::DnsUtils::Sync::sync_zone($domain);
    print $err ? $err : $response;
    print "Done\n";
}

sub synczonelocal {
    my $domain = shift;
    print "Syncing $domain to local machine...";

    my ( $response, $err ) = Cpanel::DnsUtils::Sync::sync_zone_local($domain);
    print $err ? $err : $response;
    print "Done\n";
}

sub syncall {
    my $full_sync = shift;
    print "Syncing Zones to all machines in cluster....";

    my $user_domains_only = ( $full_sync ? 0 : 1 );
    if ( !$user_domains_only ) { print "(full)..."; }

    if ( my $pid = fork() ) {
        while ( waitpid( $pid, 1 ) != -1 ) {
            syswrite( STDOUT, '.' );
            select( undef, undef, undef, 0.1 );
        }
    }
    else {

        # The default is to sync all domains in the cluster
        # for consistancy with previous behavior
        # full (!user_domains_only) then send 0
        # !full (user_domains_only) then send 1
        #
        Cpanel::DnsUtils::Sync::sync_zones($user_domains_only);
        exit(0);
    }
    print "Done\n";
}

sub syncalllocal {
    my $full_sync = shift;
    print "Syncing Zones to local machine....";

    my $user_domains_only = ( $full_sync ? 0 : 1 );
    if ( !$user_domains_only ) { print "(full)..."; }

    if ( my $pid = fork() ) {
        while ( waitpid( $pid, 1 ) != -1 ) {
            syswrite( STDOUT, '.' );
            select( undef, undef, undef, 0.1 );
        }
    }
    else {

        # The default is to sync all domains in the cluster
        # for consistancy with previous behavior
        # full (!user_domains_only) then send 0
        # !full (user_domains_only) then send 1
        #
        Cpanel::DnsUtils::Sync::sync_zones_local($user_domains_only);
        exit(0);
    }
    print "Done\n";
}

sub show_usage {
    print <<'EOM';
Usage: dnscluster [ACTION] [OPTIONS]...

Examples:
   /usr/local/cpanel/scripts/dnscluster syncall --full               # Sync all zones (even ones not in /etc/userdomains)
   /usr/local/cpanel/scripts/dnscluster synczonelocal mydomain.org   # Sync mydomain.org to the local machine

Actions:
    syncall [--full] - make sure all dns zones are
       in sync within the cluster. If any zone files
       are out out of sync, the ones with the largest
       serial numbers will be copied to all servers.

    syncalllocal [--full] - make sure all dns zones are
       in sync within the cluster. If any zone files are
       out out of sync, the ones with the largest serial
       numbers will be copied to the local server only.

    synczone <zone> - sync one zone
       If the zone is out out of sync, the one with the largest
       serial number will be copied to all servers.

    synczonelocal <zone> - sync one zone
       If the zone is out out of sync, the one with the largest
       serial number will be copied to the local server.

Operation modifiers:
    -F, --full
       If the --full flag is specified then zones that are not
       local to this server (in /etc/userdomains) will be pulled
       in as well.  This was the default behavior prior to 11.24.5

Help:
    -H, --help (or no arguments)
       This will show this screen.

EOM
    exit;
}
Uncategorized

Categoría: Uncategorized

  • Annotation du salle de jeu OnlineBingo : éditorialiste ou détail

    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.

  • Posido Scompiglio Esame critico anche gratifica di commiato 2024

    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…

  • Bonus casa da gioco online: Qual è il miglior siti bisca con gratifica? 2025

    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…

  • Au top Casino un tantinet: Livre 2025 de Champions Gaulois

    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…

  • Salle de jeu supermarkets branché Hollande to aboutisse: But nous travail and l’excellent retail market

    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.

  • Закачать Мелбет на Андроид бесплатно: официальная версия Melbet употребления

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

  • Vox Kasyno Sieciowy Poglądy Fachowców i Bonusy 2025

    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 Лучник в видах сосредоточивания и входа получите и распишитесь журнал

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

  • Мелбет зеркало непраздничное вдобавок злободневное на данный момент Melbet должностной журнал

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

  • Internet casino application company

    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.