浏览代码

ram calc fix

Denys Bashkatov 1 周之前
父节点
当前提交
336788e87e
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      setup.sh

+ 3 - 2
setup.sh

@@ -57,8 +57,9 @@ detect_architecture() {
 calculate_resource_limits() {
 calculate_resource_limits() {
     print_status "Calculating optimal resource limits based on available RAM..."
     print_status "Calculating optimal resource limits based on available RAM..."
     
     
-    # Get total RAM in MB
-    local total_ram_mb=$(free -m | awk 'NR==2{print $2}')
+    # Get total RAM in KB and convert to MB (fix for ARM64/OpenWrt)
+    local total_ram_kb=$(free | awk 'NR==2{print $2}')
+    local total_ram_mb=$((total_ram_kb / 1024))
     
     
     print_status "Total RAM detected: ${total_ram_mb}MB"
     print_status "Total RAM detected: ${total_ram_mb}MB"