Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /usr/share/rkhunter/scripts/ |
Upload File : |
#!/usr/bin/perl -w ################################################################################# # # Perl module checker 0.0.3 # ################################################################################# # # This Perl script checks for installed modules by trying to 'use' the # module. If the check fails, then the module is not present. # # If you want to install additional modules, use: # > perl -MCPAN -e shell # > install [module name] # # If the first one fails, please install the perl-CPAN package first # # Upgrade CPAN if possible: # > install Bundle::CPAN # > reload cpan # # Digest modules: # > install Digest::MD5 # > install Digest::SHA # > install Digest::SHA1 # > install Digest::SHA256 # ################################################################################# use strict; my $check = "0"; # Modules to check my @modCheck = qw( Digest::MD5 Digest::SHA Digest::SHA1 Digest::SHA256 ); # Use command-line module names if present. @modCheck = @ARGV if (@ARGV); for (@modCheck) { if (installed("$_")) { print "$_ installed (version ",$check,").\n" } else { print "$_ NOT installed.\n" } } ######################################### # # SUB: Installed modules # ######################################### sub installed { my $module = $_; # Try to use the Perl module eval "use $module"; # Check eval response if ($@) { # Module is NOT installed $check = 0; } else { # Module is installed (reset module version to '1') $check = 1; my $version = 0; # Try to retrieve version number (by using eval again) eval "\$version = \$$module\::VERSION"; # Set version number if no problem occurred $check = $version if (!$@); } # Return version number return $check; } exit(); # The end