feat: add AVX check to upgrade script

This commit is contained in:
ReturnFI
2025-09-12 18:19:23 +00:00
parent a8948c11e4
commit 9e5dbf0b37

View File

@ -22,6 +22,22 @@ success() { echo -e "${GREEN}[$(date '+%Y-%m-%d %H:%M:%S')] [OK] - ${RESET} $1";
warn() { echo -e "${YELLOW}[$(date '+%Y-%m-%d %H:%M:%S')] [WARN] - ${RESET} $1"; } warn() { echo -e "${YELLOW}[$(date '+%Y-%m-%d %H:%M:%S')] [WARN] - ${RESET} $1"; }
error() { echo -e "${RED}[$(date '+%Y-%m-%d %H:%M:%S')] [ERROR] - ${RESET} $1"; } error() { echo -e "${RED}[$(date '+%Y-%m-%d %H:%M:%S')] [ERROR] - ${RESET} $1"; }
# ========== Check AVX Support ==========
check_avx_support() {
info "Checking CPU for AVX support (required for MongoDB)..."
if grep -q -m1 -o -E 'avx|avx2|avx512' /proc/cpuinfo; then
success "CPU supports AVX instruction set."
else
error "CPU does not support the required AVX instruction set for MongoDB."
info "Your system is not compatible with this version."
info "Please use the 'nodb' upgrade script instead:"
echo -e "${YELLOW}bash <(curl -sL https://raw.githubusercontent.com/ReturnFI/Blitz/nodb/upgrade.sh)${RESET}"
error "Upgrade aborted."
exit 1
fi
}
# ========== Install MongoDB ========== # ========== Install MongoDB ==========
install_mongodb() { install_mongodb() {
info "Checking for MongoDB..." info "Checking for MongoDB..."
@ -138,6 +154,9 @@ for SERVICE in "${ALL_SERVICES[@]}"; do
fi fi
done done
# ========== Check AVX Support Prerequisite ==========
check_avx_support
# ========== Install MongoDB Prerequisite ========== # ========== Install MongoDB Prerequisite ==========
install_mongodb install_mongodb