Skip to content

Instantly share code, notes, and snippets.

@raphink
Created August 9, 2013 19:34
Show Gist options
  • Save raphink/6196504 to your computer and use it in GitHub Desktop.
Save raphink/6196504 to your computer and use it in GitHub Desktop.
augeas {
'Add line if missing':
context => '/files/myfile',
changes => 'set 01 "subversion-1.6"',
onlyif => 'match *[. =~ regex("^subversion-")] size == 0';
'Update line if present':
context => '/files/myfile',
changes => 'set *[. =~ regex("^subversion-")] "subversion-1.6"',
require => Augeas['Add line if missing'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment