From ebac0ddc3f1dbb76ad4656dbbc562855fe28f7e0 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Wed, 22 Jan 2014 13:08:49 +0100 Subject: [PATCH] fix to compare kernel versions as strings instead as numbers --- monitorix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/monitorix b/monitorix index 7daec13..e71683d 100755 --- a/monitorix +++ b/monitorix @@ -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."; }