improved the way how is extracted the kernel version

This commit is contained in:
Jordi Sanfeliu 2014-01-22 16:07:16 +01:00
parent 4cf6ca924c
commit 5b9aaac8cd
1 changed files with 7 additions and 6 deletions

View File

@ -223,12 +223,6 @@ if(!($config{hostname})) { # called from the command line
}
$config{url} .= $config{base_url};
# get the current OS and kernel version
my $release;
($config{os}, undef, $release) = uname();
my ($major, $minor) = split('\.', $release);
$config{kernel} = $major . "." . $minor;
our $mode = defined(param('mode')) ? param('mode') : '';
our $graph = param('graph');
our $when = param('when');
@ -245,6 +239,13 @@ if(lc($config{httpd_builtin}->{enabled} ne "y")) {
print("\n");
}
# get the current OS and kernel version
my $release;
($config{os}, undef, $release) = uname();
if(!($release =~ m/^(\d+)\.(\d+)/)) {
die "FATAL: unable to get the kernel version.";
}
$config{kernel} = "$1.$2";
$colors{graph_colors} = ();
$colors{warning_color} = "--color=CANVAS#880000";