From 40eafdc44eb811f007eb0dbfa9470c53ef307060 Mon Sep 17 00:00:00 2001 From: Meliox Date: Sun, 16 Jun 2024 12:00:42 +0200 Subject: [PATCH] utilise grep -e option to simplicfy if else --- pve-mod-gui-sensors.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pve-mod-gui-sensors.sh b/pve-mod-gui-sensors.sh index dfe6580..1895c02 100644 --- a/pve-mod-gui-sensors.sh +++ b/pve-mod-gui-sensors.sh @@ -124,14 +124,10 @@ function configure { "k10temp-"*) # AMD CPU # Find and set temperature search criteria - if (echo "$sensorsOutput" | grep -A 4 "$item" | grep -q "Tctl"); then + if (echo "$sensorsOutput" | grep -A 4 "$item" | grep -q -e "Tctl" -e "Tccd"); then CPU_ADDRESS_PREFIX=$item CPU_ITEM_PREFIX="Tccd" - CPU_TEMP_CAPTION="Temp" - elif (echo "$sensorsOutput" | grep -A 4 "$item" | grep -q "Tccd"); then - CPU_ADDRESS_PREFIX=$item - CPU_ITEM_PREFIX="Tccd" - CPU_TEMP_CAPTION="Temp" + CPU_TEMP_CAPTION="Temp" elif (echo "$sensorsOutput" | grep -A 4 "$item" | grep -q "temp"); then CPU_ADDRESS_PREFIX=$item CPU_ITEM_PREFIX="temp"