utilise grep -e option to simplicfy if else

This commit is contained in:
Meliox 2024-06-16 12:00:42 +02:00
parent 5185b03d49
commit 40eafdc44e

View File

@ -124,11 +124,7 @@ function configure {
"k10temp-"*)
# AMD CPU
# Find and set temperature search criteria
if (echo "$sensorsOutput" | grep -A 4 "$item" | grep -q "Tctl"); then
CPU_ADDRESS_PREFIX=$item
CPU_ITEM_PREFIX="Tccd"
CPU_TEMP_CAPTION="Temp"
elif (echo "$sensorsOutput" | grep -A 4 "$item" | grep -q "Tccd"); 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"