Add yaml front matter to all asciidoc files
[web.git] / docs / uci.txt
1 ---
2 ---
3 The UCI Configuration System
4 ============================
5
6 include::menu.inc[]
7
8 == UCI - Unified Configuration Interface
9
10 _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.
11
12 ----
13 root@lede:/# cat etc/config/system
14 config system
15 option hostname lede
16 option timezone UTC
17
18 config timeserver ntp
19 list server 0.openwrt.pool.ntp.org
20 list server 1.openwrt.pool.ntp.org
21 list server 2.openwrt.pool.ntp.org
22 list server 3.openwrt.pool.ntp.org
23 option enabled 1
24 option enable_server 0
25 ----
26
27 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.
28
29 ----
30 root@lede:/# uci show system
31 system.@system[0]=system
32 system.@system[0].hostname='lede'
33 system.@system[0].timezone='UTC'
34 system.ntp=timeserver
35 system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'
36 system.ntp.enabled='1'
37 system.ntp.enable_server='0'
38 ----
39
40 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)
41
42 ----
43 root@lede:/# uci set system.@system[0].hostname=foo
44 root@lede:/# uci commit
45 root@lede:/# reload_config
46 root@lede:/#
47 ----
48
49