Your IP : 10.0.0.1


Current Path : /scripts/
Upload File :
Current File : //scripts/comet_runtime_sync

#!/usr/local/cpanel/3rdparty/bin/perl

#                                      Copyright 2026 WebPros International, LLC
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited.

use cPstrict;

# The distinct entry point is the core/plugin capability contract. Older
# plugins lack it, so core must not mistake the legacy UI-only sync for full
# runtime reconciliation.
package scripts::comet_runtime_sync;
our $SYNC_SCRIPT = '/usr/local/cpanel/scripts/comet_license_registration_sync';

sub run (@args) {
    require $SYNC_SCRIPT;
    my ( $disable, $package_arg, $check_only, $try_lock );
    if    ( @args == 1 && $args[0] eq '--disable' )                                          { $disable     = 1; }
    elsif ( @args == 1 && $args[0] eq '--check' )                                            { $check_only  = 1; }
    elsif ( @args == 1 && $args[0] eq '--try-lock' )                                         { $try_lock    = 1; }
    elsif ( @args == 2 && $args[0] eq '--package-install' && $args[1] =~ m/\A[0-9a-z-]+\z/ ) { $package_arg = $args[1]; }
    elsif (@args)                                                                            { die "Usage: comet_runtime_sync [--disable | --check | --try-lock | --package-install mode]\n"; }
    return scripts::comet_license_registration_sync::run( $disable, $package_arg, $check_only, $try_lock );
}
unless (caller) {
    require Whostmgr::CometBackup::Logger;
    my $logger = Whostmgr::CometBackup::Logger->new();
    local $SIG{__WARN__} = sub ($message) {
        local $@;
        local $!;
        $logger->warn($message);
        print STDERR $message;
    };
    my $status = eval { run(@ARGV); };
    my $error  = $@;
    if ($error) { $logger->error($error); die $error; }
    exit $status;
}
1;