reading the following section on UCI:

http://wiki.openwrt.org/doc/uci#command.line.utility

and the following section seems really confusing:

"When there are multiple rules next to each other, UCI uses array-like
references for them. If there are 8 NTP servers, UCI will let you
reference their sections as timeserver.@timeserver[0] for the first or
timeserver.@timeserver[7] for the last one. "

  i couldn't figure out the value of a reference of the general form
"timeserver.@timeserver[?]" so i built a simple image for my d-link
and here's what i *think* is going on and i'd like someone else to
confirm it because i definitely think needs more explanation.

  i ran "uci show" and immediately saw this snippet:

dropbear.@dropbear[0]=dropbear
dropbear.@dropbear[0].PasswordAuth=on
dropbear.@dropbear[0].RootPasswordAuth=on
dropbear.@dropbear[0].Port=22

so i looked at /etc/config/dropbear and saw the following:

  config dropbear
        option PasswordAuth 'on'
        option RootPasswordAuth 'on'
        option Port         '22'
  #       option BannerFile   '/etc/banner'


ah, so i think i see what's happening. that general form represents a
/etc/config file where the "config" directive has the same name as the
file itself, which strikes me as somewhat redundant, does it not? it
seems unnecessary to have a UCI config file /etc/config/dropbear which
contains the config directive:

  config dropbear

of *course* it's configuring dropbear, we already *know* that. so
to add a further config directive like that is what produces the
visually redundant output:

# uci show dropbear
dropbear.@dropbear[0]=dropbear
dropbear.@dropbear[0].PasswordAuth=on
dropbear.@dropbear[0].RootPasswordAuth=on
dropbear.@dropbear[0].Port=22
#

is that correct?

  the file /etc/config/ucitrack file causes more of the similarly
redundant info, such as:

ucitrack.@dhcp[0]=dhcp
ucitrack.@dhcp[0].init=dnsmasq

which again seem redundant but is produced by the lines:

  config dhcp
        option init dnsmasq

am i understanding this correctly?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
_______________________________________________
openwrt-users mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-users

Reply via email to