UCI: expanded a bit, clarified difference between single and multiple values
[web.git] / docs / uci.txt
index fa40739482a2eb000bc03e6a0bd9fbaf6e3ed8dd..1129fb3dded8383f587e1b3aba156481a83d404b 100644 (file)
@@ -1,11 +1,11 @@
+---
+---
 The UCI Configuration System
 ============================
 
-include::menu.inc[]
-
 == UCI - Unified Configuration Interface
 
-_LEDE_ uses UCI to store its configuration. This is a human readable file format using typed and named section. Each section contains a number of options. Options can be single values or list of values. All configuration files are stored in the /etc/config/ folder. You can manually edit these files.
+_LEDE_ uses UCI to store its configuration. This is a human readable file format using typed and named sections. Each section contains a number of options. Options can be single values or lists of values. All configuration files are stored in the /etc/config/ folder. You can manually edit these files.
 
 ----
 root@lede:/# cat etc/config/system
@@ -22,7 +22,7 @@ config timeserver ntp
        option enable_server 0
 ----
 
-Alternatively you may use the uci CLI to read/modify their content. Using the CLI has the advantage that you do not need to worry about the validity of the syntax. Some user do however prefer to make changes manually, they should however be aware that even minor syntax errors will make the whole file unparsable and not just the specific section and/or option that was modified.
+Alternatively you may use the uci CLI to read/modify their content. Using the CLI has the advantage that you do not need to worry about the validity of the syntax. Some users do however prefer to make changes manually, they should be aware that even minor syntax errors will make the whole file unparsable and not just the specific section and/or option that was modified. UCI by default will print all the known settings (`uci show`), but also allows you to print just the settings for a subsystem, like you can see below:
 
 ----
 root@lede:/# uci show system
@@ -35,14 +35,13 @@ system.ntp.enabled='1'
 system.ntp.enable_server='0'
 ----
 
-When using the CLI to modify values, you will find that all changes first get staged and not commited to the file directly. If you want to permanently store changes you need to commit them. After calling the commit command, you can also make the system reload and apply the changes that you made.  (This will only affect services that correctly use link:procd.html[procd] init scripts)
+When using the CLI to modify values, you will find that all changes first get staged and not commited to the file directly. You can see the affected keys with `uci changes`. Single value options get set with `uci set key='value'`, list options (like 'system.ntp.server' above) with `uci add_list key='value'`. If you want to permanently store changes you need to commit them (see example below). Just like printing settings, you can commit all changes or just do so for a subset. After calling the commit command, you can also make the system reload and apply the changes that you made. (This will only affect services that correctly use link:procd.html[procd] init scripts.)
 
 ----
 root@lede:/# uci set system.@system[0].hostname=foo
-root@lede:/# uci commit
+root@lede:/# uci commit system
 root@lede:/# reload_config
 root@lede:/#
-root@foo:/#
 ----