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