help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file edit


From: Adrian Phillips
Subject: Re: file edit
Date: 06 Feb 2002 11:08:26 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

>>>>> "Daniel" == Daniel Nilsson <dlist@nlsn.nu> writes:

    Daniel> Hi!

    Daniel> Im trying to get cfengine to edit one file if another file
    Daniel> contains a specific word.

    Daniel> I tried with the following code, but it doesnt work...


    Daniel> editfiles:

    Daniel>         solaris::

    Daniel>         { /etc/mail/sendmail.cf
    Daniel> BeginGroupIfNoLineContaining "null-Client v0.1"
    Daniel> DefineClasses sendmail_edit EndGroup }


    Daniel>         sendmail_edit.solaris:: { /usr/lib/mail/cf/null.mc
    Daniel> AutoCreate EmptyEntireFilePlease AppendIfNoSuchLine
    Daniel> "VERSIONID(`null-Client v0.1')" AppendIfNoSuchLine
    Daniel> "OSTYPE(`solaris2')" AppendIfNoSuchLine
    Daniel> "FEATURE(`nullclient',`mailhost.my.domain' )"
    Daniel> AppendIfNoSuchLine "MASQUERADE_AS(`my.domain')"
    Daniel> DefineClasses "m4_run" DefineClasses "sendmail_restart" }


another way to do this :-

classes:
        doit = ( '/bin/grep -q "This is my text" file' )

editfiles:
        doit::
                { whatever

                }

Sincerely,

Adrian Phillips

-- 
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]