fix: universal RAM detection (locale-independent) (#2566)

* fix: make RAM detection compatible with all locales (free output in any language)

* Look at total RAM, not just free

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
Bruno Martins
2025-10-20 11:01:44 -03:00
committed by GitHub
parent c4f93787d6
commit f297ad1e99

View File

@@ -58,8 +58,8 @@ Categories=System;Virtualization;
EOF EOF
# Get system resources # Get system resources
TOTAL_RAM=$(free -h | grep "^Mem:" | awk '{print $2}') TOTAL_RAM=$(free -h | awk 'NR==2 {print $2}')
TOTAL_RAM_GB=$(free -g | grep "^Mem:" | awk '{print $2}') TOTAL_RAM_GB=$(awk 'NR==1 {printf "%d", $2/1024/1024}' /proc/meminfo)
TOTAL_CORES=$(nproc) TOTAL_CORES=$(nproc)
echo "" echo ""