ugreenleds-driver.plg aktualisiert

This commit is contained in:
2024-06-25 08:44:19 +02:00
parent 5257776381
commit 845a82f698

View File

@@ -141,7 +141,10 @@ if ! pidof -f "/usr/bin/ugreen-leds" >/dev/null 2>&1 ; then
fi
# Get interface from network config and check if netdevmon is already configured
INTERFACE="$(cat /boot/config/network.cfg | grep "IFNAME\[0\]" | cut -d '=' -f2 | sed 's/\"//g')"
INTERFACE="$(cat /boot/config/network.cfg | grep "IFNAME\[0\]" | cut -d '=' -f2 | sed 's/\"//g' | head -1 | tr -d '[:space:]')"
if [[ $INTERFACE =~ ^br ]]; then
INTERFACE="$(ip -o link show master $INTERFACE | awk '{print $2}' | sed 's/://' | grep -o 'eth[0-9]\+' | head -1 | tr -d '[:space:]')"
fi
if [ "$(cat /sys/class/leds/netdev/device_name)" != "${INTERFACE}" ]; then
netdevmon
fi