I'm looking at migrating some old code that uses the
uci -P /var/state style syntax.
In regard to the functions defined at
/lib/functions/network.sh and the following article:
Get WAN interface
uci -P/var/state get network.wan.ifname
The uci state vars are deprecated and not used anymore for network related information. In Trunk (not really uci) do
. /lib/functions/network.sh; network_get_device if_wan wan; echo $if_wan
. /lib/functions/network.sh; network_get_physdev if_wan wan; echo $if_wan
Can someone please explain to me the difference between
network_get_physdev with some examples? What each one is actually telling me, and when you might want to use the result from each one?
For some interfaces, it appears that they return the same result. I found that on a PPPoE interface,
network_get_device returned nothing, but
network_get_physdev returned the eth device.
For some specific examples, lets talk about what are the replacements for the following:
uci -P /var/state get network.wan.ifname
uci -P /var/state get network.wan.device
Please assume basic understanding for this question, as i think i'm missing something fundamental given that i even have to ask.