From 555067be24200c7d82fed028e1bac91e70988631 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Sun, 22 Sep 2024 16:52:25 +0200 Subject: [PATCH] cpuinfo: add fallback for cpufreq Signed-off-by: AuxXxilium --- cpuinfo/all/usr/bin/cpuinfo.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpuinfo/all/usr/bin/cpuinfo.sh b/cpuinfo/all/usr/bin/cpuinfo.sh index 6a79540..8e996f4 100755 --- a/cpuinfo/all/usr/bin/cpuinfo.sh +++ b/cpuinfo/all/usr/bin/cpuinfo.sh @@ -11,7 +11,11 @@ VENDOR="" FAMILY="" # 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 -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_GZ="${FILE_JS}.gz"