#!/usr/bin/perl
package RvglobalsoftManager::ServerInfo;
##LICENSE##
use strict;
use Carp;
use warnings;
use Cwd;
use Cwd 'realpath';
use File::Basename qw(&basename &dirname);
use Data::Dumper;
use File::Basename;
use lib dirname(realpath(__FILE__));
use lib dirname(realpath(__FILE__)).'/lib';
use lib dirname(realpath(__FILE__)).'/modules';
use RvglobalsoftManager::Rvlibary;
use CPHandle;
use vars qw(@ISA @EXPORT_OK $CONF);
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(
$OUTPUT $ERROR $CONF $VERSIONCACHE
);
sub getOS {
my $osName = RvglobalsoftManager::Rvlibary::callBackticks('uname -s');
chomp($osName);
return $osName;
}
sub getControlPanelMode {
return CPHandle::getControlPanelMode();
}
sub getControlPanelName {
return CPHandle::getControlPanelName();
}
sub getServerType {
use Sys::Detect::Virtualization;
my $detector = eval { Sys::Detect::Virtualization->new({verbose => 0}) };
if( $@ ) {
print "Detector may not be supported for your platform. Error was: $@\n";
}
my $servertype = '';
my @found = $detector->detect();
if( @found ) {
$servertype = 'VPS Server(';
$servertype .= join(', ', @found);
$servertype .= ')';
} else {
$servertype = 'Dedicated Server';
}
return $servertype;
}
sub getVersionNo {
my $fileVersion = '/usr/local/rvglobalsoft/rvglobalsoftmanager/rvglobalsoftmanagerversion.txt';
my $versionNo = '';
if(-r $fileVersion){
$versionNo = join('',RvglobalsoftManager::Rvlibary::parseTextFile($fileVersion));
}
chomp($versionNo);
$versionNo =~ s/^\s+|\s+$//g;
return $versionNo;
}
1;
Copyright 2K16 - 2K18 Indonesian Hacker Rulez