From b913b66d1a5d1455221a9841ed2a2218ddccdb25 Mon Sep 17 00:00:00 2001 From: ReturnFI <151555003+ReturnFI@users.noreply.github.com> Date: Fri, 12 Sep 2025 11:55:03 +0000 Subject: [PATCH] feat: add CPU AVX support check for MongoDB compatibility --- install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a0640ce..025f1fb 100644 --- a/install.sh +++ b/install.sh @@ -68,13 +68,22 @@ check_os_version() { if [[ "$os_name" == "ubuntu" && $(echo "$os_version >= 22" | bc) -eq 1 ]] || [[ "$os_name" == "debian" && $(echo "$os_version >= 12" | bc) -eq 1 ]]; then log_success "OS check passed: $os_name $os_version" - return 0 else log_error "This script is only supported on Ubuntu 22+ or Debian 12+." exit 1 fi + + log_info "Checking CPU for AVX support (required for MongoDB)..." + if grep -q -m1 -o -E 'avx|avx2|avx512' /proc/cpuinfo; then + log_success "CPU supports AVX instruction set." + else + log_error "CPU does not support the required AVX instruction set for MongoDB." + log_error "Installation aborted." + exit 1 + fi } + install_mongodb() { log_info "Installing MongoDB..."