From 907dd78fc1c9a9742959deb56e8ba867069d983d Mon Sep 17 00:00:00 2001 From: VIKING Date: Sat, 19 Oct 2024 12:39:46 +0800 Subject: [PATCH] package/autocore: fix WiFi temp display Fixed an issue where the home page WIFI temperature would completely disappear (awk operation error) after turning off any WIFI route. --- package/emortal/autocore/files/tempinfo | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/emortal/autocore/files/tempinfo b/package/emortal/autocore/files/tempinfo index c9fbd6d34e..8e482c6093 100755 --- a/package/emortal/autocore/files/tempinfo +++ b/package/emortal/autocore/files/tempinfo @@ -7,25 +7,25 @@ THERMAL_PATH="/sys/class/thermal" case "$DISTRIB_TARGET" in ipq40xx/*|ipq806x/*) - wifi_temp="$(awk '{printf("%.1f°C ", $0 / 1000)}' "$IEEE_PATH"/phy*/device/hwmon/hwmon*/temp1_input 2>"/dev/null" | awk '$1=$1')" + wifi_temp="$(cat "$IEEE_PATH"/phy*/device/hwmon/hwmon*/temp1_input 2>"/dev/null" | awk '{printf("%.1f°C ", $0 / 1000)}' | awk '$1=$1')" ;; mediatek/mt7622) - wifi_temp="$(awk '{printf("%.1f°C ", $0 / 1000)}' "$IEEE_PATH"/wl*/hwmon*/temp1_input 2>"/dev/null" | awk '$1=$1')" + wifi_temp="$(cat "$IEEE_PATH"/wl*/hwmon*/temp1_input 2>"/dev/null" | awk '{printf("%.1f°C ", $0 / 1000)}' | awk '$1=$1')" ;; *) - wifi_temp="$(awk '{printf("%.1f°C ", $0 / 1000)}' "$IEEE_PATH"/phy*/hwmon*/temp1_input 2>"/dev/null" | awk '$1=$1')" + wifi_temp="$(cat "$IEEE_PATH"/phy*/hwmon*/temp1_input 2>"/dev/null" | awk '{printf("%.1f°C ", $0 / 1000)}' | awk '$1=$1')" ;; esac case "$DISTRIB_TARGET" in ipq40xx/*) if [ -e "$IEEE_PATH/phy0/hwmon0/temp1_input" ]; then - mt76_temp="$(awk -F ': ' '{print $2}' "$IEEE_PATH/phy0/hwmon0/temp1_input" 2>"/dev/null")°C" + mt76_temp="$(cat "$IEEE_PATH"/phy0/hwmon0/temp1_input 2>"/dev/null" | awk -F ': ' '{print $2}')°C" fi [ -z "$mt76_temp" ] || wifi_temp="${wifi_temp:+$wifi_temp }$mt76_temp" ;; *) - cpu_temp="$(awk '{printf("%.1f°C", $0 / 1000)}' "$THERMAL_PATH/thermal_zone0/temp" 2>"/dev/null")" + cpu_temp="$(cat "$THERMAL_PATH"/thermal_zone0/temp 2>"/dev/null" | awk '{printf("%.1f°C", $0 / 1000)}')" ;; esac