On Thu, Sep 02, 2004 at 01:52:12PM +0200, Sven Mueller wrote:
test:x:1:1::/tmp/:/bin/bash
test2:x:2:2::/tmp/:/bin/bash
Here is what cfagent.conf looks like:
control:
actionsequence = ( editfiles )
editfiles:
{ /tmp/passwd
Backup "Off"
SplitOn ":"
ReplaceLinesMatchingField 1
SetLine "test::::::"
AppendIfNoLineMatching "ThisLine"
}
AFAICS, the ThisLine notation works only in a ForEachLineIn loop. You need
to give a regexp to AppendIfNoLineMatching. Further, ReplaceLinesMatching
requires either a ForEachLineIn loop or a SetLine.
So please try:
{ /tmp/passwd
Backup "Off"
SplitOn ":"
SetLine "test::::::"
ReplaceLinesMatchingField 1
AppendIfNoLineMatching "test:.*"
}