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/process_site_templates

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

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

ProcessSiteTemplates::run(@ARGV) unless caller;

package ProcessSiteTemplates;

use Getopt::Long qw(GetOptionsFromArray);
use Try::Tiny;

use File::Basename;

use Cpanel::Template        ();
use Cpanel::JSON            ();
use Cpanel::PwCache         ();
use Cpanel::SafeDir::MK     ();
use Cpanel::SafeRun::Errors ();
use Cpanel::Tar             ();

sub usage {
    my $exit_code = shift || 0;
    print <<EO_USAGE;
process_site_templates --source=/path/to/site/templates --target=/path/to/target/directory

Process Site Publisher templates from a source directory in order to generate HTML files in the target directory.
This script overwrites any existing files in the target directory.

    Options:
      --define para1=val1 Provide a value for a parameter that the template uses.

EO_USAGE

    require POSIX;
    POSIX::_exit($exit_code);
    return;
}

sub bail_out {
    my ($msg) = @_;
    print STDERR "Error: $msg\n\n";
    usage(1);
    return;
}

my ( $source, $target, $config, %parameters, $help, $tt, $bu_file, $config_file, $homedir );

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

    die "Do not run this script as the root user" if ( $> == 0 );

    $homedir = Cpanel::PwCache::gethomedir();

    my %parameters = ();

    GetOptionsFromArray(
        \@args,
        'source=s' => \$source,
        'target=s' => \$target,
        'config=s' => \$config,
        'define=s' => \%parameters,
        'help'     => \$help,
    ) || usage(1);

    if ($help) {
        usage(0);
    }

    unless ( $target && -d $target && $target =~ m/^\// ) {
        bail_out("The target directory ($target) is invalid.");
    }

    my $config_dir = $homedir . '/site_publisher/configurations';
    unless ( -d $config_dir ) {
        Cpanel::SafeDir::MK::safemkdir($config_dir);
    }
    chmod 0700, $config_dir;

    $config_file = join( '-', split( /\/+/, $target ) );
    $config_file =~ s{^-}{};
    $config_file .= '.json';
    $config_file = $config_dir . '/' . $config_file;

    my $data_file = $target . '/configurations.json';

    my $current_settings = {};

    if ( -e $config_file ) {
        eval { $current_settings = Cpanel::JSON::LoadFile($config_file) };
    }
    elsif ( -e $data_file ) {
        eval { $current_settings = Cpanel::JSON::LoadFile($data_file) };
        save_settings($current_settings);
    }
    unlink $data_file;

    try {
        do_archive();
    }
    catch {
        die "Unable to create a backup of the target directory: $_";
    };

    if ($config) {
        if ( -e $config ) {
            eval { $current_settings = Cpanel::JSON::LoadFile($config) };
        }
        else {
            die "Unable to read config file: $config";
        }
    }

    unless ( $source && -d $source ) {
        if ( $current_settings->{path} && $current_settings->{template} ) {
            $source = $current_settings->{path} . '/' . $current_settings->{template};
        }

        bail_out("The source directory ($source) is invalid.") unless $source && -d $source;
    }

    foreach my $k ( keys %parameters ) {
        $current_settings->{$k} = $parameters{$k};
    }

    try {
        process_templates($current_settings);
    }
    catch {
        my $msg = $_;

        if ( $bu_file && -e $bu_file ) {
            restore_target();
        }

        die "Publication of site template failed: $msg";
    };

    my $template = basename($source);
    my $path     = dirname($source);
    $current_settings->{'template'} = $template;
    $current_settings->{'path'}     = $path;

    save_settings($current_settings);

    return 1;
}

sub process_templates {
    my ( $data, $current_dir ) = @_;

    my $template_dir = $source;
    $template_dir .= '/' . $current_dir if ($current_dir);
    return unless ( -d $template_dir && opendir my $dh, $template_dir );

    my $dest_dir = $target;
    $dest_dir .= '/' . $current_dir if ($current_dir);
    die "The system could not create the destination directory: $dest_dir." unless ( -d $dest_dir || mkdir $dest_dir, 0755 );

    my @sub_directories = ();
    foreach my $tmpl ( readdir($dh) ) {
        next if $tmpl =~ m/^\./;
        next if $tmpl eq 'meta.json';
        next if $tmpl eq 'preview.png';
        next if $tmpl =~ m/README/i;

        if ( -d $template_dir . '/' . $tmpl ) {
            push @sub_directories, $current_dir . '/' . $tmpl;
            next;
        }

        my $dest = $tmpl;
        if ( $tmpl =~ m/\.tt$/ ) {
            $dest =~ s/\.tt$//;
            $data->{template_file} = $tmpl;
            die unless open( my $fh, '>', $dest_dir . '/' . $dest );
            my ( $success, $output ) = Cpanel::Template::process_template(
                'site_template',
                $data,
                {
                    'print_yn'     => 0,
                    'include_path' => [ $template_dir, $source ],
                }
            );
            print {$fh} $$output;
            close $fh;
        }
        else {
            my $ret = Cpanel::SafeRun::Errors::saferunonlyerrors( '/bin/cp', '-f', $template_dir . '/' . $tmpl, $dest_dir . '/' . $dest );
            die $ret if scalar grep ( /cannot/i, split( /\n/, $ret ) );
        }
    }
    close $dh;

    foreach my $sub (@sub_directories) {
        process_templates( $data, $sub );
    }

    return 1;
}

sub do_archive {
    $bu_file = join( '-', split( /\/+/, $target ) );
    $bu_file =~ s{^-}{};
    $bu_file .= '-' . $$ . '-' . time();

    my $bu_dir = $homedir . '/site_publisher/backups';
    unless ( -d $bu_dir ) {
        Cpanel::SafeDir::MK::safemkdir($bu_dir);
    }
    chmod 0700, $bu_dir;

    # discard things older than 30 days
    if ( opendir( my $dh, $bu_dir ) ) {
        my @old_files = grep /-\d+-\d+\.tar\.gz$/, readdir($dh);
        closedir $dh;

        my $current = time();
        my $cutoff  = $current - 30 * 24 * 60 * 60;

        foreach my $f (@old_files) {
            my @pots  = split( /-/, $f );
            my $stamp = $pots[-1];
            $stamp =~ s{\.tar\.gz$}{};
            if ( $stamp < $cutoff ) {
                unlink $bu_dir . '/' . $f;
            }
        }
    }

    $bu_file = $bu_dir . '/' . $bu_file . '.tar.gz';
    my $ret = Cpanel::SafeRun::Errors::saferunonlyerrors( Cpanel::Tar::load_tarcfg()->{'bin'}, '-c', '-v', '-z', '-f', $bu_file, $target );
    die $ret if scalar grep ( /error/i, split( /\n/, $ret ) );

    return;
}

sub restore_target {
    Cpanel::SafeRun::Errors::saferunnoerror( '/usr/bin/rm', '-rf', '--', $target );
    chdir '/';
    Cpanel::SafeRun::Errors::saferunnoerror( Cpanel::Tar::load_tarcfg()->{'bin'}, '-x', '-v', '-z', '-f', $bu_file );

    return;
}

sub save_settings {
    my ($settings) = @_;
    my $orig_mask = umask 0077;
    my $out_fh;
    unless ( open( $out_fh, '>', $config_file ) ) {
        die "The system could not save settings to the file: $config_file";
    }

    require Cpanel::JSON::Sanitize;
    print {$out_fh} Cpanel::JSON::Dump( Cpanel::JSON::Sanitize::sanitize_for_dumping($settings) );
    close $out_fh;
    umask $orig_mask;

    return;
}

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