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

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

use strict;
use warnings;

use Cpanel::FileUtils::Lines  ();
use Cpanel::FileUtils::Modify ();
use Cpanel::ServerTasks       ();

use Getopt::Long;
use Pod::Usage;
use Try::Tiny;

our $INTERCHANGE_FILE         = '/etc/chkserv.d/interchange';
our $INTERCHANGE_RESTART_FILE = '/var/run/chkservd/restart_track/interchange';
our $CHKSERVD_CONF_FILE       = '/etc/chkserv.d/chkservd.conf';

sub new {
    my $pkg  = shift;
    my $self = {};
    bless $self, $pkg;
    return $self;
}

sub as_script {
    my $self = shift;

    my $execute = 0;
    my $help    = 0;
    Getopt::Long::GetOptions(
        'x'    => \$execute,
        'help' => \$help,
    );

    if ($help) {
        Pod::Usage::pod2usage(
            -verbose => 2,
            -exitval => 1,
        );
    }

    if ( not $execute ) {
        my $msg = qq{To execute, use the -x flag.};
        die($msg);
    }

    $self->run();

    return 1;
}

sub run {
    my $self = shift;

    my $restart_tailwatchd;

    if ( -e $INTERCHANGE_FILE ) {
        unlink($INTERCHANGE_FILE);
        ++$restart_tailwatchd;
    }
    if ( -e $INTERCHANGE_RESTART_FILE ) {
        unlink($INTERCHANGE_RESTART_FILE);
    }
    if ( -e $CHKSERVD_CONF_FILE ) {
        if ( Cpanel::FileUtils::Lines::has_txt_in_file( $CHKSERVD_CONF_FILE, 'interchange' ) ) {
            Cpanel::FileUtils::Modify::remlinefile( $CHKSERVD_CONF_FILE, 'interchange:', 'begin' );
            ++$restart_tailwatchd;
        }
    }

    if ($restart_tailwatchd) {
        local $@;
        try {
            Cpanel::ServerTasks::queue_task( ['TailwatchTasks'], 'reloadtailwatch' );
        }
        catch {
            warn "There was an error restarting tailwatchd: $_";
        };
    }

    return 0;
}

if ( not caller() ) {
    my $cleanup = scripts::cleanupinterchange->new();
    $cleanup->as_script;
    exit 0;
}

1;

__END__

=head1 NAME

cleanupinterchange - cleans up cruft left over from the interchange removal

=head1 SYNOPSIS

cleanup_interchange [options]

  Options:
    -help      print help message
    -x         execute the change

=head1 DESCRIPTION

In cPanel & WHM version 11.34, we removed Interchange, but small remnants
were left behind. This script cleans up that clutter. If the remnants have
already been removed, this script does nothing.

=cut
Seguro Celular
Home business sonyw300 6 de febrero de 2020
SEGURO PARA CUALQUIER MOMENTO
Evita cualquier situación con nuestro seguro para celular.

Contar con un seguro para celular te brinda una protección integral contra situaciones comunes como robo, accidentes y pérdida. No solo te ahorrará dinero en reparaciones o reemplazos, sino que también te proporcionará la tranquilidad de saber que estás respaldado en caso de cualquier eventualidad. Es una inversión inteligente para salvaguardar tu dispositivo, tus datos y tu tranquilidad.

De viaje
Protegido siempre ante cualquier imprevisto
Contratar ahora!
Robo
Asegura tu equipo ante un posible robo
Contratar ahora!
Accidentes
No pases un mal momento, protege tu dispositivo
Contratar ahora!
Previous slide
Next slide
¿Porqué seguro celular es para ti?
Nos comprometemos en brindarte la mejor protección para tu dispositivo
Cobertura mundial

Sea cual sea el problema estamos aquí para proteger tu inversión y brindarte la tranquilidad que necesitas.

Proceso de reclamación fácil y rápido

Sabemos que necesitas una solución rápida en caso de cualquier incidente.

Opciones personalizadas:

Ofrecemos opciones flexibles que se adaptan a tus requisitos individuales.

Atención al cliente excepcional

Estamos disponible para responder y brindarte asistencia personalizada en todo momento.

Tu tranquilidad está a
solo un clic de distancia

Protege tu dispositivo de cualquier imprevisto
TESTIMONIOS
¿Qué dicen nuestros
valiosos clientes?
"¡Increíble servicio de seguro para celular! Rápido, eficiente y confiable. Mi reclamo fue procesado sin problemas y recibí un reemplazo de mi teléfono en tiempo récord. ¡Gracias por brindar una excelente protección para mis dispositivos!"
male1085054890319
Herman Miller
"Me encanta la tranquilidad que me brinda su servicio de seguro para celular. Sé que mi dispositivo está protegido contra cualquier daño accidental o robo. Además, el proceso de reclamación es sencillo. Super recomendado!
female1021755931884
Sofia Millan
"Me ha salvado en más de una ocasión. El personal siempre está dispuesto a ayudar y resolver cualquier problema que surja. Gracias a su servicio, puedo disfrutar de mi teléfono sin preocupaciones.
male20131085934506012
Alexander Rodriguez