[augeas-devel] Parsing network-scripts/ifcfg-*
David Lutterkort
dlutter at redhat.com
Tue Apr 22 00:00:46 UTC 2008
On Tue, 2008-04-22 at 00:47 +0100, Daniel P. Berrange wrote:
> Can augtool take args and turn them into variables, which can be subsituted
> in. eg say you had a script
>
> $ cat > nicsonboot.aug <<EOF
> set /files/etc/sysconfig/network-scripts/ifcfg-eth0/ONBOOT $onboot
> set /files/etc/sysconfig/network-scripts/ifcfg-br0/ONBOOT $onboot
> EOF
No, it doesn't. You can achieve a similar effect with a simple shell
script that does the above cat, substituting its args for $onboot (or
use the Ruby/Python bindings for more complicated things).
> $ augtool nicsonboot.aug --onboot=no
One small misconception: .aug files are not for manipulating the tree,
they contain descriptions of file <-> tree mappings. augtool reads those
files, constructs a tree based on the descriptions, and lets the user
manipulate them with set/rm etc. commands before writing the tree back
into files according to the descriptions.
I just realized that my initial example is missing a 'save' at the end.
The language for describing file <-> tree mappings is much more full
featured and has variables etc. but no way to make persistent changes to
files.
David
More information about the augeas-devel
mailing list