Thanks for the ubus pointers, Bastian. That should solve it :)

Johan




On Mon, Nov 17, 2014 at 10:34 AM, Bastian Bittorf <bitt...@bluebottle.com>
wrote:

> * Johan Almbladh <j...@anyfi.net> [17.11.2014 10:22]:
> > The hotplug scripts receive events for interface names, but they know
> > nothing about the underlying configuration. Is there any way to map a
> WLAN
> > interface name, e.g. wlan0, to the corresponding UCI config entry in
> > /etc/config/wireless?
>
> /sbin/hotplug-call exports some global shell-vars, which you
> can use in your script, e.g.:
>
> ACTION - e.g. 'ifup'
> INTERFACE - e.g. 'mywan'
> DEVICE - e.g. eth0.2
>
> if you need some more, you can query them in your
> script with e.g.
>
> ubus call network.interface.mywan status
>
> you can parse the JSON with e.g.
>
> . /usr/share/libubox/jshn.sh
> OUT="$( ubus call network.interface.mywan status )"
> eval $( jshn -r "$OUT" )
> echo $JSON_VAR_status
>
> bye, bastian
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to