Commit 07f685b3 authored by David Johnson's avatar David Johnson

Add getKernelVersion, which returns (major,minor,patch).

parent afed8661
......@@ -17,6 +17,7 @@ use Exporter;
findControlNet findIface findMac
existsBridge findBridge findBridgeIfaces
findVirtControlNet findDNS downloadImage setState
getKernelVersion
);
use Data::Dumper;
......@@ -494,6 +495,21 @@ sub mysystem2($)
}
}
#
# Get kernel (major,minor,patchlevel) version tuple.
#
sub getKernelVersion()
{
my $kernvers = `cat /proc/sys/kernel/osrelease`;
chomp $kernvers;
if ($kernvers =~ /^(\d+)\.(\d+)\.(\d+)/) {
return ($1,$2,$3);
}
return undef;
}
#
# Life's a rich picnic. And all that.
1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment