autocore: trim whitespace when wifi_temp is empty

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-05-12 15:28:00 +08:00
parent f0ac305e35
commit e6c7d13d23
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -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