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
|
# get the current OS and kernel version and check its support
|
||||||
my $release;
|
my $release;
|
||||||
($config{os}, undef, $release) = uname();
|
($config{os}, undef, $release) = uname();
|
||||||
my ($major, $minor) = split('\.', $release);
|
if(!($release =~ m/^(\d+)\.(\d+)/)) {
|
||||||
$minor =~ m/^(\d+)/;
|
die "FATAL: unable to get the kernel version.";
|
||||||
$config{kernel} = $major . "." . $1;
|
}
|
||||||
|
$config{kernel} = "$1.$2";
|
||||||
|
|
||||||
if(!grep {$_ eq $config{os}} @suppsys) {
|
if(!grep {$_ eq $config{os}} @suppsys) {
|
||||||
die "FATAL: your operating system ($config{os}) is not supported.";
|
die "FATAL: your operating system ($config{os}) is not supported.";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue