apply regions
This commit is contained in:
parent
155655cda5
commit
bb7b798796
@ -138,6 +138,7 @@ function configure {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#### CPU ####
|
#### CPU ####
|
||||||
|
#region cpu setup
|
||||||
msgb "\n=== Detecting CPU temperature sensors ==="
|
msgb "\n=== Detecting CPU temperature sensors ==="
|
||||||
ENABLE_CPU=false
|
ENABLE_CPU=false
|
||||||
local cpuList=""
|
local cpuList=""
|
||||||
@ -185,17 +186,14 @@ function configure {
|
|||||||
else
|
else
|
||||||
warn "No CPU temperature sensors found."
|
warn "No CPU temperature sensors found."
|
||||||
fi
|
fi
|
||||||
|
#endregion cpu setup
|
||||||
|
|
||||||
#### RAM ####
|
#### RAM ####
|
||||||
|
#region ram setup
|
||||||
msgb "\n=== Detecting RAM temperature sensors ==="
|
msgb "\n=== Detecting RAM temperature sensors ==="
|
||||||
local ramList=$(echo "$sensorsOutput" | grep -o '"SODIMM[^"]*"' | sed 's/"//g' | paste -sd, -)
|
local ramList=$(echo "$sensorsOutput" | grep -o '"SODIMM[^"]*"' | sed 's/"//g' | paste -sd, -)
|
||||||
local ramCount=$(echo "$ramList" | tr ',' '\n' | wc -l)
|
local ramCount=$(echo "$ramList" | tr ',' '\n' | wc -l)
|
||||||
|
|
||||||
# Clean up if no RAM found
|
|
||||||
if [ -z "$ramList" ]; then
|
|
||||||
ramCount=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ramCount" -gt 0 ]; then
|
if [ "$ramCount" -gt 0 ]; then
|
||||||
info "Detected RAM sensors ($ramCount): $ramList"
|
info "Detected RAM sensors ($ramCount): $ramList"
|
||||||
ENABLE_RAM_TEMP=true
|
ENABLE_RAM_TEMP=true
|
||||||
@ -204,8 +202,10 @@ function configure {
|
|||||||
warn "No RAM temperature sensors found."
|
warn "No RAM temperature sensors found."
|
||||||
ENABLE_RAM_TEMP=false
|
ENABLE_RAM_TEMP=false
|
||||||
fi
|
fi
|
||||||
|
#endregion ram setup
|
||||||
|
|
||||||
#### HDD/SSD ####
|
#### HDD/SSD ####
|
||||||
|
#region hdd setup
|
||||||
msgb "\n=== Detecting HDD/SSD temperature sensors ==="
|
msgb "\n=== Detecting HDD/SSD temperature sensors ==="
|
||||||
local hddList=($(echo "$sensorsOutput" | grep -o '"drivetemp-scsi[^"]*"' | sed 's/"//g'))
|
local hddList=($(echo "$sensorsOutput" | grep -o '"drivetemp-scsi[^"]*"' | sed 's/"//g'))
|
||||||
if [ ${#hddList[@]} -gt 0 ]; then
|
if [ ${#hddList[@]} -gt 0 ]; then
|
||||||
@ -216,8 +216,10 @@ function configure {
|
|||||||
warn "No HDD/SSD temperature sensors found."
|
warn "No HDD/SSD temperature sensors found."
|
||||||
ENABLE_HDD_TEMP=false
|
ENABLE_HDD_TEMP=false
|
||||||
fi
|
fi
|
||||||
|
#endregion hdd setup
|
||||||
|
|
||||||
#### NVMe ####
|
#### NVMe ####
|
||||||
|
#region nvme setup
|
||||||
msgb "\n=== Detecting NVMe temperature sensors ==="
|
msgb "\n=== Detecting NVMe temperature sensors ==="
|
||||||
local nvmeList=($(echo "$sensorsOutput" | grep -o '"nvme[^"]*"' | sed 's/"//g'))
|
local nvmeList=($(echo "$sensorsOutput" | grep -o '"nvme[^"]*"' | sed 's/"//g'))
|
||||||
if [ ${#nvmeList[@]} -gt 0 ]; then
|
if [ ${#nvmeList[@]} -gt 0 ]; then
|
||||||
@ -228,8 +230,10 @@ function configure {
|
|||||||
warn "No NVMe temperature sensors found."
|
warn "No NVMe temperature sensors found."
|
||||||
ENABLE_NVME_TEMP=false
|
ENABLE_NVME_TEMP=false
|
||||||
fi
|
fi
|
||||||
|
#endregion nvme setup
|
||||||
|
|
||||||
#### Fans ####
|
#### Fans ####
|
||||||
|
#region fan setup
|
||||||
msgb "\n=== Detecting fan speed sensors ==="
|
msgb "\n=== Detecting fan speed sensors ==="
|
||||||
|
|
||||||
local fanList=""
|
local fanList=""
|
||||||
@ -264,8 +268,10 @@ function configure {
|
|||||||
warn "No fan speed sensors found."
|
warn "No fan speed sensors found."
|
||||||
ENABLE_FAN_SPEED=false
|
ENABLE_FAN_SPEED=false
|
||||||
fi
|
fi
|
||||||
|
#endregion fan setup
|
||||||
|
|
||||||
#### Temperature Units ####
|
#### Temperature Units ####
|
||||||
|
#region temp unit setup
|
||||||
if [ "$SENSORS_DETECTED" = true ]; then
|
if [ "$SENSORS_DETECTED" = true ]; then
|
||||||
local unit=$(ask "Display temperatures in Celsius [C] or Fahrenheit [f]? (C/f)")
|
local unit=$(ask "Display temperatures in Celsius [C] or Fahrenheit [f]? (C/f)")
|
||||||
case "$unit" in
|
case "$unit" in
|
||||||
@ -283,8 +289,10 @@ function configure {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
#endregion temp unit setup
|
||||||
|
|
||||||
#### UPS ####
|
#### UPS ####
|
||||||
|
#region ups setup
|
||||||
local choiceUPS=$(ask "Enable UPS information? (y/N)")
|
local choiceUPS=$(ask "Enable UPS information? (y/N)")
|
||||||
case "$choiceUPS" in
|
case "$choiceUPS" in
|
||||||
[yY])
|
[yY])
|
||||||
@ -318,8 +326,10 @@ function configure {
|
|||||||
ENABLE_UPS=false
|
ENABLE_UPS=false
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
#endregion ups setup
|
||||||
|
|
||||||
#### System Info ####
|
#### System Info ####
|
||||||
|
#region system info setup
|
||||||
msgb "\n=== Detecting System Information ==="
|
msgb "\n=== Detecting System Information ==="
|
||||||
for i in 1 2; do
|
for i in 1 2; do
|
||||||
echo "type ${i})"
|
echo "type ${i})"
|
||||||
@ -347,6 +357,7 @@ function configure {
|
|||||||
SYSTEM_INFO_TYPE=1
|
SYSTEM_INFO_TYPE=1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
#endregion system info setup
|
||||||
|
|
||||||
#### Final Check ####
|
#### Final Check ####
|
||||||
if [ "$SENSORS_DETECTED" = false ] && [ "$ENABLE_UPS" = false ] && [ "$ENABLE_SYSTEM_INFO" = false ]; then
|
if [ "$SENSORS_DETECTED" = false ] && [ "$ENABLE_UPS" = false ] && [ "$ENABLE_SYSTEM_INFO" = false ]; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user