mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-01 17:34:40 +01:00
map-agent: hotplug: send topology discovery on eth link up
This commit is contained in:
parent
1ba929a1bc
commit
a6b4cccfcc
1 changed files with 22 additions and 0 deletions
22
map-agent/files/etc/hotplug.d/ethernet/map-topology-discovery
Executable file
22
map-agent/files/etc/hotplug.d/ethernet/map-topology-discovery
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
[ "$LINK" == "up" ] || exit 0
|
||||
[ "$PORT" == "" ] && exit 1
|
||||
|
||||
ubus list ieee1905 > /dev/null 2>&1
|
||||
|
||||
rc="$?"
|
||||
|
||||
[ "$rc" != 0 ] && exit 1
|
||||
|
||||
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"$PORT\"}")
|
||||
|
||||
json_load "$res" > /dev/console 2>&1
|
||||
json_get_var data data
|
||||
|
||||
[ "$data" == "" ] && exit 1
|
||||
|
||||
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}"
|
||||
Loading…
Add table
Reference in a new issue