1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import '*' { define ($file, $line, $refreshonly = 'false') { exec {"/bin/echo '$line' >> '$file'": unless => "grep -Fxqe '$line' '$file'", path => "/bin:/usr/bin", refreshonly => "$refreshonly", } } define ($file, $pattern) { exec {"/bin/sed -i -r -e '/$pattern/d' $file": path => "/bin:/usr/bin", onlyif => "grep -E '$pattern' '$file'", } } } |

