cpuinfo: add fallback for cpufreq

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-09-22 16:52:25 +02:00
parent 3f92c609ab
commit 555067be24

View File

@ -11,7 +11,11 @@ VENDOR=""
FAMILY="" # str FAMILY="" # str
SERIES="$(echo $(grep 'model name' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2))" # str SERIES="$(echo $(grep 'model name' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2))" # str
CORES="$(grep 'cpu cores' /proc/cpuinfo 2>/dev/null | wc -l)" # str CORES="$(grep 'cpu cores' /proc/cpuinfo 2>/dev/null | wc -l)" # str
SPEED="$(echo $(grep 'MHz' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2 | cut -d. -f1))" # int SPEED="$(dmidecode 2>/dev/null | grep MHz | head -1 | cut -d: -f2 | cut -d ' ' -f2))" # int
if [ -z "${SPEED}" ] || [[ ! "${SPEED}" =~ ^[0-9]+$ ]]; then
SPEED="$(echo $(grep 'MHz' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2 | cut -d. -f1))" # int
fi
FILE_JS="/usr/syno/synoman/webman/modules/AdminCenter/admin_center.js" FILE_JS="/usr/syno/synoman/webman/modules/AdminCenter/admin_center.js"
FILE_GZ="${FILE_JS}.gz" FILE_GZ="${FILE_JS}.gz"