Uci console - how to get section by name instead of index

Hey guys,
as the title states, how do I get the section info with uci via name instead of index. i.e: suppose I have the following network file


config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'


config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.1.1'



how would I get the 'lan' ifname of instead of using the constant [1] index which may change?

i.e I can currently do: uci get network.@interface[1].ifname

How would I know '1' is the correct index for lan? or can I get the name in any way?

thanks

Does uci show network.lan work?

1 Like
uci show network
uci get network.lan.proto
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.