Elektra
0.8.18
|
The blockresolver
can be used to only resolved a tagged block inside a configuration file.
blockresolver
extracts the requested block from the configurations file and writes it into a temporary file. Afterwards Elektra will only work on the temporary file until kdbSet is called. On kdbSet the contents of the temporary file will be merged with parts outside of the requested block from the original file.
kdb mount -R blockresolver /path/to/my/file /mountpoint -c identifier="identifier-tag"
where identifier
specifies the tag blockresolver
will search for in the configuration file.
A block consists of 2 parts:
start
stop
Currently the identifier must be unique.
``` % cat /tmp/test.block bla bla bla
[section1] key1 = val1 [section2] key2 = val2
asdf asdf asdf
% kdb mount -R blockresolver /tmp/test.block system/blocktest -c identifier="### block config" % kdb export system/blocktest [section1] key1 = val1 [section2] key2 = val2
% kdb set system/blocktest/section1/key12 val12 Create a new key system/blocktest/section1/key12 with string val12
% cat /tmp/test.block bla bla bla
[section1] key1 = val1 key12 = val12 [section2] key2 = val2
asdf asdf asdf ```