diff --git a/ct/unifi.sh b/ct/unifi.sh index 5be90bda..d8813fd0 100644 --- a/ct/unifi.sh +++ b/ct/unifi.sh @@ -17,10 +17,6 @@ cat <<"EOF" EOF } header_info -if ! grep -q -m1 'avx[^ ]*' /proc/cpuinfo; then - echo "AVX instruction set is not supported on this CPU." - exit -fi echo -e "Loading..." APP="Unifi" var_disk="8" diff --git a/install/unifi-install.sh b/install/unifi-install.sh index 90a71247..6c37a6a6 100644 --- a/install/unifi-install.sh +++ b/install/unifi-install.sh @@ -28,11 +28,25 @@ $STD apt-get update $STD apt-get install -y temurin-17-jre msg_ok "Installed Eclipse Temurin JRE" -msg_info "Installing MongoDB" -wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor >/usr/share/keyrings/mongodb-server-7.0.gpg -echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" >/etc/apt/sources.list.d/mongodb-org-7.0.list -$STD apt-get update -$STD apt-get install -y mongodb-org +if grep -q 'avx' /proc/cpuinfo; then + msg_ok "No AVX Support Detected" + msg_info "Installing MongoDB 4.2" + if ! dpkg -l | grep -q "libssl1.1"; then + wget -q http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u6_amd64.deb + $STD dpkg -i libssl1.1_1.1.1n-0+deb10u6_amd64.deb + $STD apt-get install -f -y # Fix any broken dependencies + fi + wget -qO- https://www.mongodb.org/static/pgp/server-4.2.asc | gpg --dearmor > /usr/share/keyrings/mongodb-server-4.2.gpg + echo "deb [signed-by=/usr/share/keyrings/mongodb-server-4.2.gpg] https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" >/etc/apt/sources.list.d/mongodb-org-4.2.list + $STD apt-get update + $STD apt-get install -y mongodb-org=4.2.17 +else + msg_info "Installing MongoDB 7.0" + wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor >/usr/share/keyrings/mongodb-server-7.0.gpg + echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" >/etc/apt/sources.list.d/mongodb-org-7.0.list + $STD apt-get update + $STD apt-get install -y mongodb-org +fi msg_ok "Installed MongoDB" msg_info "Installing UniFi Network Server" diff --git a/json/unifi.json b/json/unifi.json index cd9cd269..66484787 100644 --- a/json/unifi.json +++ b/json/unifi.json @@ -32,8 +32,8 @@ }, "notes": [ { - "text": "CPU with AVX Instruction Set required", + "text": "For non-AVX CPUs, MongoDB 4.2 is installed. Please note this is a legacy solution that may present security risks and could become unsupported in future updates.", "type": "warning" } ] -} \ No newline at end of file +}