Ganteng Doang Upload Shell Gak Bisa


Linux server.jmdstrack.com 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
/ scripts/

//scripts/synccpaddonswithsqlhost

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

# cpanel - scripts/synccpaddonswithsqlhost         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 warnings;
use Carp;
use File::Spec;

use Cpanel::AccessIds ();
use Cpanel::OS        ();
use Cpanel::cPAddons  ();

my %valid_addons;
my $myhost;
my $cpaddons_base = '/usr/local/cpanel/cpaddons';

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

sub run {
    my (@args) = @_;

    unshift @INC, $cpaddons_base;

    if ( !Cpanel::OS::supports_cpaddons() ) {
        die qq[cPAddons are not supported on this distro.\n];
    }

    if ( -e q[/var/cpanel/cpaddons.disabled] ) {
        die qq[cPAddons are disabled on this server.\n];
    }

    %valid_addons = map { $_ => 1 } list_cpaddons();
    $myhost       = get_root_mysql_host();

    print "Syncing Site Software installations with current MySQL host setting!\n\n";

    for my $user ( @{ get_all_users_or_arg_ref() } ) {
        process_user($user);
    }

    return;
}

sub process_user {
    my ($user) = @_;
    print "Processing $user...\n";

    my $home = ( getpwnam($user) )[7];

    if ( !defined $home ) {
        carp "Could not determine home for $user";
        return;
    }

    my @cpaddons;

    if ( opendir my $cpaddons_dh, "$home/.cpaddons/" ) {
        @cpaddons = grep { /\:\:/ } readdir $cpaddons_dh;
        closedir $cpaddons_dh;
    }
    else {
        carp "Can not read .cpaddons/ for $user, skipping: $!";
        return;
    }

    my $cpaddons_processed = process_user_cpaddons( $user, $home, @cpaddons );

    if ($cpaddons_processed) {
        my $s = $cpaddons_processed == 1 ? '' : 's';
        print "$user had $cpaddons_processed cpaddon$s synced\n";
    }
    else {
        print "$user had no cpaddons needing their mysql host synced\n";
    }
    print "$user Done!\n\n";

    return 1;
}

sub process_user_cpaddons {
    my ( $user, $home, @cpaddons ) = @_;
    my $cpaddons_processed = 0;

    for my $aod (@cpaddons) {
        print "\tChecking $aod...\n";

        my $install_hashref = {};

        if ( !Cpanel::cPAddons::_read_cache( "$home/.cpaddons/$aod", $install_hashref, $user ) ) {
            carp "Could not read $aod: $!";
            next;
        }

        my $mod = $aod;
        $mod =~ s{\.yaml$}{};
        $mod =~ s{\.\d+$}{};

        if ( !exists( $valid_addons{$mod} ) ) {
            carp "Skipping $aod, It does not appear that $mod is a valid or installed cPaddon.";
            next;
        }

        my $mod_file = $mod;
        $mod_file =~ s/::/\//g;
        $mod_file = $mod_file . '.pm';
        require $mod_file;

        if ($@) {
            carp "Skipping $aod, Could not get $mod info (is $mod installed?): $!";
            next;
        }
        else {
            no strict 'refs';
            my $info_hr = ${"$mod\:\:meta_info"};
            use strict 'refs';

            for my $db ( @{ $info_hr->{'mysql'} } ) {

                my $current_setting = $install_hashref->{"mysql.$db.sqlhost"} || '';
                next if ( $myhost eq $current_setting )                       || ( !$myhost || !$current_setting );
                print "\t\tDifference detected, syncing...\n";

                for my $conf ( @{ $info_hr->{'config_files'} } ) {
                    my $path = File::Spec->catdir( $install_hashref->{'installdir'}, $conf );
                    print "\t\t\tProcessing $path...";
                    process_user_config_file( $user, $current_setting, $myhost, $path );
                    print "Done!\n";
                }
                $install_hashref->{"mysql.$db.sqlhost"} = $myhost;
                $install_hashref->{'mysql'}{$db}{'sqlhost'} = $myhost;

                if ( !Cpanel::cPAddons::_write_cache( "$home/.cpaddons/$aod", $install_hashref, $user ) ) {
                    carp "Could not save $aod: $!";
                    next;
                }

                print "\t\t$aod is done\n";
                $cpaddons_processed++;
            }
        }
    }

    return;
}

sub process_user_config_file {
    my ( $user, $current_setting, $host, $path ) = @_;

    Cpanel::AccessIds::do_as_user(
        $user,
        sub {
            if ( open( my $fh, '+<', $path ) ) {
                my @lines = map { my $s = $_; $s =~ s/$current_setting/$myhost/g; $s } <$fh>;
                seek $fh, 0, 0;
                print {$fh} join( '', @lines );
                truncate( $fh, tell $fh );
                close($fh);
            }
            else {
                carp "Failed to open '$path' for reading and writing: $!";
            }
        },
    );

    return;
}

sub get_root_mysql_host {
    my $myhost = '';
    open my $mycnf_fh, '<', '/root/.my.cnf'
      or croak "Set MySQL root passwd: $!";
    while (<$mycnf_fh>) {
        if ( $_ =~ m/host\s*\=/ ) {
            ($myhost) = $_ =~ m/host\s*\=\s*\"?([^\"\s]+)\"?/;
            last;
        }
    }
    close $mycnf_fh;
    return $myhost || 'localhost';
}

sub get_all_users_or_arg_ref {
    my $arg_location = shift || 0;
    my $user_to_run  = defined $ARGV[$arg_location]
      && $ARGV[$arg_location] ? $ARGV[$arg_location] : '';
    my $user_lookup_ref = get_user_lookup_ref();

    my @users_to_transform = keys %{$user_lookup_ref};

    if ($user_to_run) {
        if ( exists $user_lookup_ref->{$user_to_run} ) {
            @users_to_transform = ($user_to_run);
        }
        else {
            croak 'Unknown user';
        }
    }
    return \@users_to_transform;
}

sub get_user_lookup_ref {
    my $user_lookup = {};

    open( my $TUD, '<', '/etc/trueuserdomains' ) or die "trueuserdomains failed: $!";
    while (<$TUD>) {
        my ($user) = $_ =~ m/\:\s+(\w+)/;
        $user_lookup->{$user}++ if $user;
    }
    close $TUD;
    return $user_lookup;
}

sub list_cpaddons {
    my @cpaddons;

    opendir( my $bdh, $cpaddons_base );
    my @pals = grep !/^\.+$/, readdir $bdh;
    closedir $bdh;

    for my $pal (@pals) {
        next if !-d "$cpaddons_base/$pal";

        opendir( my $cdh, "$cpaddons_base/$pal" );
        my @cats = grep !/^\.+$/, readdir $cdh;
        closedir($cdh);

        for my $cat (@cats) {
            next if !-d "$cpaddons_base/$pal/$cat";

            opendir( my $sdh, "$cpaddons_base/$pal/$cat" );
            my @subs = grep /\.pm$/, readdir $sdh;
            closedir($sdh);

            for my $sub (@subs) {
                $sub =~ s/\.pm$//;
                push @cpaddons, "$pal\:\:$cat\:\:$sub";
            }
        }
    }

    return @cpaddons;
}

1;
			
			


Thanks For 0xGh05T - DSRF14 - Mr.Dan07 - Leri01 - FxshX7 - AlkaExploiter - xLoveSyndrome'z - Acep Gans'z

JMDS TRACK – Just Another Diagnostics Lab Site

Home

JMDS TRACK Cameroon

Boost the productivity of your mobile ressources


Make An Appointment


Fleet management

  1. Reduce the operting cost and the unavailability of your vehicles
  2. reduce the fuel consumption of your fleet
  3. Improve the driving dehavior and safety of your drivers
  4. optimize the utilization rate of your equipment 
  5. protect your vehicle against theft
  6. Improve the quality of your customer service


Find out more

Assets management

  1. Track the roaming of your equipment
  2. Optimise the management of your assets on site and during transport
  3. Secure the transport of your goods
  4. Make your team responsible for preventing the loss of tools, equipment
  5. Take a real-time inventory of your equipment on site
  6. Easily find your mobile objects or equipment



Find out more



Find out more

Antitheft solutions

  1. Secure your vehicles and machinery and increase your chances of recovering them in the event of theft
  2. Protect your assets and reduce the costs associated with their loss
  3. Combine immobiliser and driver identification and limit the risk of theft
  4. Identify fuel theft and reduce costs
  5. Protect your goods and take no more risks
  6. Be alerted to abnormal events

Our Location

 Douala BP cité 

     and

Yaoundé Total Essos


Make An Appointment


Get Directions

682230363/ 677481892

What makes us different from others

  • young and dynamic team
  • call center 24/24 7/7
  • roaming throughout Africa
  • team of developers who can develop customer-specific solutions
  • diversity of services
  • reactive and prompt after-sales service when soliciting a customer or a malfunction
  • Free Maintenance and installation in the cities of Douala and Yaounde

https://youtu.be/xI1cz_Jh2x8

15+
years of experience in GPS system development, production and deployment.

15 Collaborators

More than 15 employees dedicated to the research and development of new applications and to customer care

5 000 Vehicles and mobile assets

5 000 vehicles and mobile assets under management, in Africa

Our Partners










Latest Case Studies

Our current projects 

5/5
Bon SAV , SATISFAIT DU TRAITEMENT DES REQUETES

M DIPITA CHRISTIAN
Logistic Safety Manager Road Safety Manager
5/5
La réactivité de JMDS est excellente
Nous restons satisfait dans l’ensemble des prestations relatives a la couverture de notre parc automobile

Hervé Frédéric NDENGUE
Chef Service Adjoint de la Sécurité Générale (CNPS)
5/5
L’APPLICATION EMIXIS est convivial A L’utilisation
BEIG-3 SARL
DIRECTOR GENERAL
5/5
Nevertheless I am delighted with the service
MR. BISSE BENJAMIN
CUSTOMER

Subsribe To Our Newsletter

Stay in touch with us to get latest news and special offers.



Address JMDS TRACK

Douala bp cité



and

YAOUNDE Total Essos

Call Us

+237682230363



Email Us


info@jmdstrack.cm