X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=config%2Fcfgroot%2Fgeneral-functions.pl;h=e8495e88543c860af953c6238f6291021ede66e9;hp=0577afe2809e62b3de113f96b3819ab04a43d917;hb=1a3323f2e6aa4ebe701f2e61a6829c8bedb7eb10;hpb=79b89b90e4b9425e29551bd8ceb8a85cd224c62d diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 0577afe280..e8495e8854 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1165,5 +1165,12 @@ sub dnssec_status() { return $status; } +sub number_cpu_cores() { + open my $cpuinfo, "/proc/cpuinfo" or die "Can't open cpuinfo: $!\n"; + my $cores = scalar (map /^processor/, <$cpuinfo>); + close $cpuinfo; + + return $cores; +} 1;