diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2009-12-25 22:33:24 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2009-12-25 22:33:24 -0200 |
commit | a25d1e44c24ba52885a2b795387fe733798f85ed (patch) | |
tree | 50fc558b09b205ba6b2ea5bd867add6a1b8e48f0 | |
parent | 0f5508374a63dbf0f7bfeb70e2e8f33bf24f891b (diff) | |
download | puppet-common-a25d1e44c24ba52885a2b795387fe733798f85ed.tar.gz puppet-common-a25d1e44c24ba52885a2b795387fe733798f85ed.tar.bz2 |
Adding delete_lines
-rw-r--r-- | manifests/defines/delete_lines.pp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/manifests/defines/delete_lines.pp b/manifests/defines/delete_lines.pp new file mode 100644 index 0000000..28d2362 --- /dev/null +++ b/manifests/defines/delete_lines.pp @@ -0,0 +1,5 @@ +define delete_lines($file, $pattern) { + exec { "/bin/sed -i -r -e '/$pattern/d' $file": + onlyif => "/bin/grep -E '$pattern' '$file'", + } +} |