Help in uci (uci-defaults) - need proper format

Hello
I am writing multiple commands to bring my openwrt flash and boot to my configuration. I am using uci-defaults scripts while downloading the build (as I understand it runs only once after flash and then deletes itself)

I am stumped at the following config which i need to get into /etc/config/wireless-

config wifi-vlan
option name 'vlan35'
option network 'vlan35'
option vid '35'

config wifi-station
option key 'xxxxxxx'
option vid '35'

I tried the following (which is not correct)

uci set wireless.@wifi-vlan[0]=wifi-vlan
uci set wireless.@wifi-vlan[0].name='vlan35'
uci set wireless.@wifi-vlan[0].network='vlan35'
uci set wireless.@wifi-vlan[0].vid='35'
uci set wireless.@wifi-station[0]=wifi-station
uci set wireless.@wifi-station[0].key='xxxxxx'
uci set wireless.@wifi-station[0].vid='35'

Please help in getting the lines added into my wireless config file.
Thank you

I find it far more easy, if using the image-builder, to build with FILES= and simply include all files into the image. That way it simply boots and is done.

uci add wireless wifi-vlan
uci set wireless.@wifi-vlan[-1].name='vlan35'
uci set wireless.@wifi-vlan[-1].network='vlan35'
uci set wireless.@wifi-vlan[-1].vid='35'

uci add wireless wifi-station
uci set wireless.@wifi-station[-1].key='xxxxxx'
uci set wireless.@wifi-station[-1].vid='35'
2 Likes

The odd thing is, the wiki actually recommends using uci defaults to change the config files instead of outright replacing them.

1 Like

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