From 0e9e1c63bc431c83a358c5b8c3d58aef758b19f8 Mon Sep 17 00:00:00 2001 From: AuxXxilium Date: Wed, 22 May 2024 20:27:31 +0200 Subject: [PATCH] cpufreq: more rewrite Signed-off-by: AuxXxilium --- cpuinfo/all/usr/bin/cpuinfo.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cpuinfo/all/usr/bin/cpuinfo.sh b/cpuinfo/all/usr/bin/cpuinfo.sh index 188086e..dfdbb24 100755 --- a/cpuinfo/all/usr/bin/cpuinfo.sh +++ b/cpuinfo/all/usr/bin/cpuinfo.sh @@ -9,13 +9,13 @@ VENDOR="" FAMILY="" SERIES="$(echo $(grep 'model name' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2))" -CORES="$(grep 'cpu cores' /proc/cpuinfo 2>/dev/null | wc -l)" -SPEED="$(echo $(($(grep 'model name' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2 | awk '{print $NF}' | tr -d -c 0-9) * 10)))" -if [ -z "${SPEED}" ] || [ ${SPEED} -eq 0 ]; then - SPEED="$(echo $(grep 'cpu MHz' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2))" - while [ ${SPEED} -lt 1000 ]; do - SPEED="$((${SPEED} * 10))" - done +if [ -z "${SERIES}" ]; then + SERIES="$(cat /proc/cpuinfo | grep -E "model name" | head -1 | cut -d: -f2)" +fi +CORES="$(grep 'cpu cores' /proc/cpuinfo 2>/dev/null | wc -l)" +SPEED="$(echo $(grep 'MHz' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2 | cut -d. -f1))" +if [ -z "${SPEED}"] || [ ${SPEED} -eq 800 ]; then + SPEED="$(cat /proc/cpuinfo | grep -E "cpu MHz" | head -1 | cut -d: -f2 | cut -d. -f1)" fi FILE_JS="/usr/syno/synoman/webman/modules/AdminCenter/admin_center.js"