mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
ledcontrol: fix some values
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
7958ad5d19
commit
b7c9bf56cc
@ -19,14 +19,12 @@ function check_network_interface() {
|
|||||||
|
|
||||||
if [ "${1}" = "on" ]; then
|
if [ "${1}" = "on" ]; then
|
||||||
echo "Enable Ugreen LED"
|
echo "Enable Ugreen LED"
|
||||||
${UGREEN_LEDS_CLI} all -on -color 255 255 255 -brightness 65
|
${UGREEN_LEDS_CLI} all -on -color 255 255 255 -brightness 255
|
||||||
elif [ "${1}" = "off" ]; then
|
elif [ "${1}" = "off" ]; then
|
||||||
echo "Disable Ugreen LED"
|
echo "Disable Ugreen LED"
|
||||||
${UGREEN_LEDS_CLI} all -off
|
${UGREEN_LEDS_CLI} all -off
|
||||||
else
|
else
|
||||||
${UGREEN_LEDS_CLI} all -off
|
${UGREEN_LEDS_CLI} all -off
|
||||||
brightness=255
|
|
||||||
color="0 255 0" # Grün
|
|
||||||
# NIC Status
|
# NIC Status
|
||||||
interface_up=0
|
interface_up=0
|
||||||
interfaces=$(ls /sys/class/net 2>/dev/null | grep eth)
|
interfaces=$(ls /sys/class/net 2>/dev/null | grep eth)
|
||||||
@ -39,24 +37,18 @@ else
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ ${interface_up} -eq 1 ]; then
|
if [ ${interface_up} -eq 1 ]; then
|
||||||
${UGREEN_LEDS_CLI} netdev -on -color ${color} -brightness ${brightness} >/dev/null 2>&1
|
${UGREEN_LEDS_CLI} netdev -on -color 0 255 0 -brightness 255 >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# CPU
|
# CPU
|
||||||
${UGREEN_LEDS_CLI} power -on -color ${color} -brightness $brightness >/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')
|
||||||
disk_number=0
|
disk_number=0
|
||||||
for i in ${devices}; do
|
for i in ${devices}; do
|
||||||
disk_number=$((${disk_number} + 1)) # Disknummer für die LED-Steuerung (disk1, disk2, etc.)
|
disk_number=$((${disk_number} + 1)) # Disknummer für die LED-Steuerung (disk1, disk2, etc.)
|
||||||
smartstatus=$(smartctl -H ${i} | grep "SMART Health Status")
|
${UGREEN_LEDS_CLI} disk${disk_number} -on -color 0 255 0 -brightness 255 >/dev/null 2>&1
|
||||||
if [ $(echo ${smartstatus} | grep -q 'OK' | wc -l) -gt 0 ]; then
|
|
||||||
color="0 255 0" # Grün
|
|
||||||
else
|
|
||||||
color="255 0 0" # Rot
|
|
||||||
fi
|
|
||||||
${UGREEN_LEDS_CLI} disk${disk_number} -on -color ${color} -brightness ${brightness} >/dev/null 2>&1
|
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user