From e6c7d13d233f0d1464d5cb3f490ac14d0cb29e58 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 12 May 2023 15:28:00 +0800 Subject: [PATCH] autocore: trim whitespace when wifi_temp is empty Signed-off-by: Tianling Shen --- package/emortal/autocore/files/tempinfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/emortal/autocore/files/tempinfo b/package/emortal/autocore/files/tempinfo index a82377a679..1a366d0198 100755 --- a/package/emortal/autocore/files/tempinfo +++ b/package/emortal/autocore/files/tempinfo @@ -13,7 +13,7 @@ if grep -q "ipq40xx" "/etc/openwrt_release"; then 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" fi - [ -z "$mt76_temp" ] || wifi_temp="$wifi_temp $mt76_temp" + [ -z "$mt76_temp" ] || wifi_temp="${wifi_temp:+$wifi_temp }$mt76_temp" else cpu_temp="$(awk '{printf("%.1f°C", $0 / 1000)}' "$THERMAL_PATH/thermal_zone0/temp" 2>"/dev/null")" fi