Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 39 lines (31 sloc) 1.131 kb
e89b1568 »
2011-01-05 Initial Checkin of the cPanel API Call Tracer
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
8bf0577e »
2011-01-06 Refactor the CustomEventHandler to use InMemoryFH and add a version c…
6 use File::Copy ();
e89b1568 »
2011-01-05 Initial Checkin of the cPanel API Call Tracer
7
8bf0577e »
2011-01-06 Refactor the CustomEventHandler to use InMemoryFH and add a version c…
8 if ( open ( my $version_fh, '<', '/usr/local/cpanel/version' ) ) {
9 my $version
10 read($version_fh, $version, 32);
11 close ($version_fh);
12 $version =~ s/^(\d\.\d).+/$1/;
13 if ( $version < 11.28 ) {
14 die "This version of the cPanel API Call tracer requires cpanel 11.28.x or greater";
15 }
16 }
17 else {
18 die "This is only intended for use with cPanel & WHM servers";
e89b1568 »
2011-01-05 Initial Checkin of the cPanel API Call Tracer
19 }
20
21 if ( -e '/usr/local/cpanel/Cpanel/CustomEventHandler.pm' ) {
22 die 'A CustomEventHandler already exists, aborting installation';
23 }
24
8bf0577e »
2011-01-06 Refactor the CustomEventHandler to use InMemoryFH and add a version c…
25
e89b1568 »
2011-01-05 Initial Checkin of the cPanel API Call Tracer
26 File::Copy::copy("Dumper.pm", "/usr/local/cpanel/perl/Data/Dumper.pm");
27 File::Copy::copy("CustomEventHandler.pm", "/usr/local/cpanel/Cpanel/CustomEventHandler.pm");
28
29 if ( $! ) {
8bf0577e »
2011-01-06 Refactor the CustomEventHandler to use InMemoryFH and add a version c…
30 print "An error occurred during installation:\n$!\n";
e89b1568 »
2011-01-05 Initial Checkin of the cPanel API Call Tracer
31 }
32 else {
33 print "Installation Successful, please run:\n";
34 print "\ttail -f /usr/local/cpanel/logs/error_log\n\n";
8bf0577e »
2011-01-06 Refactor the CustomEventHandler to use InMemoryFH and add a version c…
35 print "and login to the cPanel interface\n\n";
36 print "IMPORTANT: This should never be left installed on a server, to uninstall:\n";
37 print "rm /usr/local/cpanel/Cpanel/CustomEventHandler.pm\n";
e89b1568 »
2011-01-05 Initial Checkin of the cPanel API Call Tracer
38 }
Something went wrong with that request. Please try again.