mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
Revert "ethmngr: removed deprecated ethport hotplug handler"
This reverts commit dcfa48d1f7.
This commit is contained in:
parent
78eb76e913
commit
ee6a27dc76
2 changed files with 24 additions and 1 deletions
|
|
@ -5,7 +5,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=3.0.7
|
||||
PKG_VERSION:=3.0.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ -n "$PORT" -a -n "$LINK" ] || exit 0
|
||||
|
||||
case "$PORT" in
|
||||
# do not generate ethport ubus event
|
||||
# for wifi, dsl and brige devices
|
||||
wl*|wds*|atm*|ptm*|br-*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
speed=0
|
||||
duplex=full
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
devspeed="$(ubus -t 2 call network.device status "{\"name\":\"$PORT\"}" | jsonfilter -e @.speed)"
|
||||
speed=${devspeed:0:-1}
|
||||
duplex=${devspeed:0-1}
|
||||
[ "$duplex" == "H" ] && duplex="half" || duplex="full"
|
||||
fi
|
||||
|
||||
ubus send ethport "{\"ifname\":\"$PORT\",\"link\":\"$LINK\",\"speed\":\"$speed\",\"duplex\":\"$duplex\"}"
|
||||
Loading…
Add table
Reference in a new issue