<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; "></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; ">My sed-fu isn't strong enough to answer that directly, but cobbler does an excellent job of dynamically generating custom kickstart files for custom classes.&nbsp;</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; ">One creates one or a few kickstart templates, including Python&nbsp;code snippets which handle the customization magic; they're extremely powerful. Cobbler, based upon the template(s) and short descriptions of particular systems, generates custom kickstart files for each
 server.</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; ">The %post section can include all sorts of sed-fu and so forth, combined with the ability to pull in information ( such as host name, IP address, yadda yadda ) from the system description.&nbsp;</div><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span><a target="_blank" href="https://fedorahosted.org/cobbler/">https://fedorahosted.org/cobbler/</a></span></font><br><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">I'd be happy to consult with anyone who wishes to set up such a system.</font></div><div><font class="Apple-style-span"
 face="arial, helvetica, sans-serif"><br></font></div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="3">Terry McIntyre &lt;terrymcintyre@yahoo.com&gt;</font><br><br><div style="color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; ">Unix/Linux Systems Administration<br>Taking time to do it right saves having to do it twice.<div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Gabriel L. Somlo &lt;gsomlo@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> wplug@wplug.org<br><b><span style="font-weight: bold;">Sent:</span></b> Thu, March 3, 2011 10:02:27 AM<br><b><span style="font-weight: bold;">Subject:</span></b> [wplug] sed kung-fu and the art of kickstart file maintenance<br></font><br>
Hi,<br><br>I maintain a bunch of kickstart files for a few classes of machines I<br>deal with. A frequent thing happening in the %post section is that<br>some config files get edited in a small way, by either appending or<br>modifying a few lines. I do that using here-documents and sed,<br>respectively.<br><br>Recently, I encountered a situation where I need to insert a few lines<br>into a config file at a *specific* location. I figured, in order to<br>stay consistent with my previous style, I'd use sed *and* here-documents<br>to do the job, but all I could come up was this:<br><br>sed -i 's/\[section_title\]/cat/e' /etc/configfile.conf &lt;&lt;EOT<br>[section_title]<br> foo<br> bar<br> blah<br>EOT<br><br>Is there a way to write something like this without the need to<br>repeat the string '[section_title'' in the here-document ? Something<br>more along the lines of the 'a' sed command instead of 's' ?<br><br>Or am I making this way too complicated ?
 :)<br><br>Thanks,<br>--Gabriel<br>_______________________________________________<br>wplug mailing list<br><a ymailto="mailto:wplug@wplug.org" href="mailto:wplug@wplug.org">wplug@wplug.org</a><br><span><a target="_blank" href="http://www.wplug.org/mailman/listinfo/wplug">http://www.wplug.org/mailman/listinfo/wplug</a></span><br></div></div></div><div style="position: fixed; color: black; font-family: arial, helvetica, sans-serif; font-size: 12pt; "></div>


</div><br>

      </body></html>