mirror of https://github.com/mikaku/Monitorix.git
fix to compare kernel versions as strings instead as numbers
This commit is contained in:
parent
da948cb885
commit
ebac0ddc3f
|
@ -388,9 +388,11 @@ $config{func_update} = ();
|
|||
# get the current OS and kernel version and check its support
|
||||
my $release;
|
||||
($config{os}, undef, $release) = uname();
|
||||
my ($major, $minor) = split('\.', $release);
|
||||
$minor =~ m/^(\d+)/;
|
||||
$config{kernel} = $major . "." . $1;
|
||||
if(!($release =~ m/^(\d+)\.(\d+)/)) {
|
||||
die "FATAL: unable to get the kernel version.";
|
||||
}
|
||||
$config{kernel} = "$1.$2";
|
||||
|
||||
if(!grep {$_ eq $config{os}} @suppsys) {
|
||||
die "FATAL: your operating system ($config{os}) is not supported.";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue