| Server IP : 23.111.136.34 / Your IP : 216.73.216.136 Web Server : Apache System : Linux servidor.eurohost.com.br 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : meusitei ( 1072) PHP Version : 5.6.40 Disable Function : show_source, system, shell_exec, passthru, proc_open MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /scripts/ |
Upload File : |
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - scripts/install_cpanel_analytics 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::install_cpanel_analytics;
use strict;
use warnings;
use Getopt::Long ();
use Cpanel::Imports;
use Cpanel::Plugins ();
use Cpanel::Analytics::UiIncludes ();
__PACKAGE__->run() if !caller();
sub run {
if ( $> != 0 ) {
die "$0: must run as root\n";
}
my $help;
Getopt::Long::GetOptionsFromArray(
\@ARGV,
'help' => \$help,
)
and ( !@ARGV )
or do {
usage(1);
exit 1; ## no critic qw(Cpanel::NoExitsFromSubroutines) -- pre-existing code; exit when displaying usage
};
if ($help) {
usage();
exit;
}
logger()->info(q{Installing the analytics plugin.});
require Cpanel::Plugins;
eval { Cpanel::Plugins::install_plugins('cpanel-analytics'); };
logger()->warn($@) if $@ && ref $@ !~ m/ProcessFailed/; # ProcessFailed stacks aren't very interesting.
logger()->info(q{Enabling the analytics user interface.});
if ( $ENV{'CPANEL_BASE_INSTALL'} ) {
local $@;
eval {
require Cpanel::Analytics::UiIncludes;
Cpanel::Analytics::UiIncludes::enable();
};
logger()->warn($@) if length $@;
}
return 1;
}
sub usage {
my ($status) = @_;
my $msg = <<"EOM";
install_cpanel_analytics: install cpanel-analytics plugin
Usage:
install_cpanel_analytics [--help]
Options:
--help: print usage and exit
EOM
if ($status) {
print STDERR $msg;
}
else {
print $msg;
}
return;
}
1;