From e786b09199bf2cf3c8282e2e0940ca859ceeb941 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A5vard=20Gj=C3=B8by=20Thom?=
 <34199185+havardthom@users.noreply.github.com>
Date: Thu, 28 Nov 2024 12:13:46 +0100
Subject: [PATCH] Fix MongoDB install in Unifi script (#564)

---
 install/unifi-install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install/unifi-install.sh b/install/unifi-install.sh
index 6c37a6a6..5bf36a76 100644
--- a/install/unifi-install.sh
+++ b/install/unifi-install.sh
@@ -28,7 +28,7 @@ $STD apt-get update
 $STD apt-get install -y temurin-17-jre
 msg_ok "Installed Eclipse Temurin JRE"
 
-if grep -q 'avx' /proc/cpuinfo; then
+if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then
   msg_ok "No AVX Support Detected"
   msg_info "Installing MongoDB 4.2"
   if ! dpkg -l | grep -q "libssl1.1"; then