Browse Source

ram calc fix

Denys Bashkatov 1 week ago
parent
commit
336788e87e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      setup.sh

+ 3 - 2
setup.sh

@@ -57,8 +57,9 @@ detect_architecture() {
 calculate_resource_limits() {
     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"