[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: editfiles problem - revisited
From: |
Josef Wolf |
Subject: |
Re: editfiles problem - revisited |
Date: |
Thu, 2 Sep 2004 14:25:41 +0200 |
User-agent: |
Mutt/1.4.1i |
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:.*"
}
--
Please visit and sign and http://www.ffii.org
-- Josef Wolf -- jw@raven.inka.de --