Merge pull request #71 from cloos/linux-memory
fix fetching memory values on non-english Linux systems
This commit is contained in:
commit
393cd62adb
1 changed files with 2 additions and 2 deletions
|
@ -226,8 +226,8 @@ sub os_setup {
|
|||
}
|
||||
} else {
|
||||
if ($os =~ /Linux/) {
|
||||
$physical_memory = `free -b | grep Mem | awk '{print \$2}'` or memerror;
|
||||
$swap_memory = `free -b | grep Swap | awk '{print \$2}'` or memerror;
|
||||
$physical_memory = `LANG=en free -b | grep Mem | awk '{print \$2}'` or memerror;
|
||||
$swap_memory = `LANG=en free -b | grep Swap | awk '{print \$2}'` or memerror;
|
||||
} elsif ($os =~ /Darwin/) {
|
||||
$physical_memory = `sysctl -n hw.memsize` or memerror;
|
||||
$swap_memory = `sysctl -n vm.swapusage | awk '{print \$3}' | sed 's/\..*\$//'` or memerror;
|
||||
|
|
Loading…
Reference in a new issue