ledcontrol: fix disk number

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-11-17 13:29:41 +01:00
parent c9c231e65e
commit 45fac6d694

View File

@ -44,11 +44,12 @@ else
${UGREEN_LEDS_CLI} power -on -color 255 255 255 -brightness 255 >/dev/null 2>&1 ${UGREEN_LEDS_CLI} power -on -color 255 255 255 -brightness 255 >/dev/null 2>&1
# Disks # Disks
devices=$(ls -d /dev/sata*[1-9] 2>/dev/null | grep -v 'p') devices=$(($(ls -d /dev/sata*[1-9] 2>/dev/null | grep -v 'p' | wc -l) - 1))
disk_number=0 disk_number=0
for i in ${devices}; do while true; do
disk_number=$((${disk_number} + 1)) # Disknummer für die LED-Steuerung (disk1, disk2, etc.) disk_number=$((disk_number + 1))
${UGREEN_LEDS_CLI} disk${disk_number} -on -color 0 255 0 -brightness 255 >/dev/null 2>&1 ${UGREEN_LEDS_CLI} disk${disk_number} -on -color 0 255 0 -brightness 255 >/dev/null 2>&1
[ ${disk_number} -eq ${devices} ] && break
done done
fi fi