#!/usr/bin/env bash RED='\033[1;31m' GRN='\033[1;32m' PPL='\033[1;35m' NC='\033[0m' arch="$(uname -m)" have_sha1=0 have_sha2=0 lscpu_output="$(lscpu)" cpu="$(echo "${lscpu_output}" | grep "Model name" | sed -e "s/.*: *//g")" cpu_compatible=1; check_is() { if echo "${lscpu_output}" | grep ${1} > /dev/null; then printf "\thas the ${PPL}${2}${NC} instruction set ${GRN}✔${NC}\n" else cpu_compatible=0 printf "\tdoes not have the ${PPL}${2}${NC} instruction set ❌\n" fi } printf "Your ${PPL}${arch}${NC} CPU ${PPL}'${cpu}'${NC}...\n" if [ "${arch}" == "x86_64" ]; then check_is "pclmul" "PCLMUL" check_is "avx2" "AVX2" check_is "sha_ni" "SHA" elif [ "${arch}" == "aarch64" ]; then check_is "crc32" "CRC32" check_is "asimd" "NEON" check_is "sha1" "SHA-1" check_is "sha2" "SHA-2" else cpu_compatible=0 fi if [ "${cpu_compatible}" -eq 1 ]; then printf "CPU is ${GRN}COMPATIBLE${NC} with ${PPL}disc-kuraudo-home-premium${NC}!.\n" printf "Get your premium version today: https://disc-kuraudo.eu/premium\n" else printf "CPU is ${RED}NOT COMPATIBLE${NC} with ${PPL}disc-kuraudo-home-premium${NC}!.\n" fi