help-cfengine
[Top][All Lists]
Advanced

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

Re: editfiles question


From: Ed Brown
Subject: Re: editfiles question
Date: Wed, 01 Sep 2004 09:48:53 -0600

This could be very useful, and a very timely suggestion, for a recent
situation, where I've been creating some accounts manually, for lack of
time to find a real solution.  (Also, it's helpful to have examples, not
having used the ...FileItems and ...FromFile actions before.)

thanks,
Ed


On Wed, 2004-09-01 at 09:30, Mark.Burgess@iu.hio.no wrote:
> This any use?
> 
> http://www.cfengine.org/confdir/customizepasswd.html
> 
> M
> 
> On  1 Sep, Ed Brown wrote:
> > Right.  No root line, no editing.  Useful for setting the root passwd in
> > /etc/shadow, where if there's not an entry for root, something is pretty
> > seriously wrong.  Guess I didn't read your requirements carefully
> > enough.
> >  
> > 
> > 
> > On Wed, 2004-09-01 at 09:00, Sven Mueller wrote:
> >> Ed Brown [u] wrote on 01/09/2004 16:44:
> >> 
> >> > Here's another approach:
> >> > 
> >> > editfiles:
> >> >    { /etc/whatever
> >> >           BeginGroupIfNoLineMatching "root:$1raboof:4875::::::"
> >> >                  LocateLineMatching "^root:.*"
> >> >                  ReplaceLineWith "root:$1raboof:4875::::::"
> >> >           EndGroup
> >> >    }
> >> 
> >> Wouldn't that approach replace some other line if no line matching 
> >> "^root:.*" was found while no line matching "root:$1raboof:4875::::::" 
> >> existed before?
> >> Hmm, no, according to the documentation, if LocateLineMatching doesn't 
> >> find a match, it aborts any further editing. So your approach will only 
> >> replace existing lines, but if none matching "root:.*" is found, it 
> >> won't do anything.
> >> 
> >> cu,
> >> sven
> > 
> > 
> > 
> > _______________________________________________
> > Help-cfengine mailing list
> > Help-cfengine@gnu.org
> > http://lists.gnu.org/mailman/listinfo/help-cfengine
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 




reply via email to

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