Use the config command line tool to change a device's configuration database. Functions supported include: inspect a tree, read/write values, and import/export enitre tree sections.
The command line argument help generates this:
$ config help
Usage:
To read a value:
config get <tree path>
To write a value:
config set <tree path> <new value> [<type>]
To delete a node:
config delete <tree path>
To import config data:
config import <tree path> <file path>
To export config data:
config export <tree path> <file path>
To list all config trees:
config list
Where:
<tree path>: Path to the tree and node to configure.
<file path>: Path to the file for import/export.
<new value>: String value to write to the config tree.
<type>: Optional, must be bool, int, float, or string.
If type is bool, value must be true or false.
If unspecified, default type is string.
A tree path is specified similar to a *nix path. With the beginning slash
being optional.
For example:\n"
/a/path/to/somewhere
or
a/path/to/somewhere
The configTree supports multiple trees: a default tree is assigned per user.
If the config tool is run as root, then alternative trees can be specified
in the path by entering a tree name, then a colon and the value path.
Here's an example using the tree named 'foo' instead of the default tree:
foo:/a/path/to/somewhere
The trees themselves are stored in the file system at:
The configTree cycles through the extensions, .rock, .paper, and .scissors to differentiate between versions of the tree file. The base file name is the same as the tree.
A listing for /opt/legato/configTree where the system tree and the user trees are foo and bar looks like this:
The system, or root user, has its own tree; each application has a separate tree.
To dump a tree, run this to get the default tree for the current user:
Or to get a specific tree:
The tool can also read and write individual values. You can read the value of greeted like this:
If you want to see everything under helloWorld:
If you want to change the value of ignored:
You can check it by running:
If the config tool is listing a tree it will display the node name and a / if the current node has children. (Except for the root node, as the root node does not have a name.)
For leaf nodes, the config tool will display the value type in angle brackets, <>, as well as its name and actual value:
Copyright (C) Sierra Wireless, Inc. 2014. All rights reserved. Use of this work is subject to license.