Changes

5,388 bytes added ,  10:48, 22 January 2018
no edit summary
Line 4: Line 4:     
UCI commands provide the user with the maximum degree of control since they can be issued via many different forms of router monitoring and administration (SSH, CLI, SMS, JSON-RPC) and can be used to set or get any router parameter. This chapter is a guide on how to use UCI commands with RUT devices.
 
UCI commands provide the user with the maximum degree of control since they can be issued via many different forms of router monitoring and administration (SSH, CLI, SMS, JSON-RPC) and can be used to set or get any router parameter. This chapter is a guide on how to use UCI commands with RUT devices.
 +
 +
==Available commands==
 +
 +
This section provides a list of possible UCI commands and options.
 +
 +
{| class="wikitable"
 +
|+ UCI commands
 +
! style="width: 100px; background: black; color: white;"  | Command
 +
! style="width: 200px; background: black; color: white;"  | Target
 +
! style="width: 1200px; background: black; color: white;" | Description
 +
|-
 +
! style="text-align: left; vertical-align: top;" | batch
 +
| style="text-align: left; vertical-align: top;" | -
 +
| style="text-align: left; vertical-align: top;" | Executes a multi-line UCI script which is typically wrapped into a here document syntax
 +
|-
 +
! style="text-align: left; vertical-align: top;" | export
 +
| style="text-align: left; vertical-align: top;" | [<config>]
 +
| style="text-align: left; vertical-align: top;" | Exports the configuration in a machine readable format. It is used internally to evaluate configuration files as shell scripts
 +
|-
 +
! style="text-align: left; vertical-align: top;" | import
 +
| style="text-align: left; vertical-align: top;" | [<config>]
 +
| style="text-align: left; vertical-align: top;" | Imports configuration files in UCI syntax
 +
|-
 +
! style="text-align: left; vertical-align: top;" | changes
 +
| style="text-align: left; vertical-align: top;" | [<config>]
 +
| style="text-align: left; vertical-align: top;" | Lists staged changes to the given configuration file or if none given, all configuration files
 +
|-
 +
! style="text-align: left; vertical-align: top;" | commit
 +
| style="text-align: left; vertical-align: top;" | [<config>]
 +
| style="text-align: left; vertical-align: top;" | Writes changes of the given configuration file, or if none is given, all configuration files, to the filesystem. All "uci set", "uci add", "uci rename" and "uci delete" commands are staged into a temporary location until they are written to flash with the "uci commit" command. This is used exclusively for UCI commands and is not needed after editing configuration files with a text editor
 +
|-
 +
! style="text-align: left; vertical-align: top;" | add
 +
| style="text-align: left; vertical-align: top;" | <config> <section-type>
 +
| style="text-align: left; vertical-align: top;" | Adds an anonymous section of type ''section-type'' to the given configuration
 +
|-
 +
! style="text-align: left; vertical-align: top;" | add_list
 +
| style="text-align: left; vertical-align: top;" | <config>.<section>.<option>=<string>
 +
| style="text-align: left; vertical-align: top;" | Adds the given ''string'' to an existing list option
 +
|-
 +
! style="text-align: left; vertical-align: top;" | del_list
 +
| style="text-align: left; vertical-align: top;" | <config>.<section>.<option>=<string>
 +
| style="text-align: left; vertical-align: top;" | Removes the given ''string'' from an existing list option
 +
|-
 +
! style="text-align: left; vertical-align: top;" | show
 +
| style="text-align: left; vertical-align: top;" | [<config>[.<section>[.<option>]]]
 +
| style="text-align: left; vertical-align: top;" | Shows the given option, section or configuration in compressed notation. If no option is given, shows all configuration files
 +
|-
 +
! style="text-align: left; vertical-align: top;" | get
 +
| style="text-align: left; vertical-align: top;" | <config>.<section>[.<option>]
 +
| style="text-align: left; vertical-align: top;" | Gets the value of the given option or the type of the given section
 +
|-
 +
! style="text-align: left; vertical-align: top;" | set
 +
| style="text-align: left; vertical-align: top;" | <config>.<section>[.<option>]=<value>
 +
| style="text-align: left; vertical-align: top;" | Sets the value of the given option, or add a new section with the type set to the given ''value''
 +
|-
 +
! style="text-align: left; vertical-align: top;" | delete
 +
| style="text-align: left; vertical-align: top;" | <config>[.<section>[[.<option>][=<id>]]]
 +
| style="text-align: left; vertical-align: top;" | Deletes the given section or option
 +
|-
 +
! style="text-align: left; vertical-align: top;" | rename
 +
| style="text-align: left; vertical-align: top;" | <config>.<section>[.<option>]=<name>
 +
| style="text-align: left; vertical-align: top;" | Renames the given option or section to the given name
 +
|-
 +
! style="text-align: left; vertical-align: top;" | revert
 +
| style="text-align: left; vertical-align: top;" | <config>[.<section>[.<option>]]
 +
| style="text-align: left; vertical-align: top;" | Reverts the given option, section or configuration file. Used to undo any changes performed with UCI and not yet committed with ''uci commit''
 +
|-
 +
! style="text-align: left; vertical-align: top;" | reorder
 +
| style="text-align: left; vertical-align: top;" | <config>.<section>=<position>
 +
| style="text-align: left; vertical-align: top;" | Moves the specified section to the given ''position''. Used for easier management purposes
 +
|-
 +
|}
 +
 +
Options:
 +
-c <path>  set the search path for config files (default: /etc/config)
 +
-d <str>  set the delimiter for list values in uci show
 +
-f <file>  use <file> as input instead of stdin
 +
-m        when importing, merge data into an existing package
 +
-n        name unnamed sections on export (default)
 +
-N        don't name unnamed sections
 +
-p <path>  add a search path for config change files
 +
-P <path>  add a search path for config change files and use as default
 +
-q        quiet mode (don't print error messages)
 +
-s        force strict mode (stop on parser errors, default)
 +
-S        disable strict mode
 +
-X        do not use extended syntax on 'show'
    
==Obtaining parameters==
 
==Obtaining parameters==

Navigation menu