<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
On Wed, 2005-11-02 at 10:54 -0500, Scott Sherrill wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Henry Burroughs wrote:</FONT>

<FONT COLOR="#000000">> Is there a script to change all the private network settings </FONT>
<FONT COLOR="#000000">> (/etc/hosts, lts.conf, and other files)?  That way if someone is </FONT>
<FONT COLOR="#000000">> trying to deploy it already on a 192.168.0.* network, they can </FONT>
<FONT COLOR="#000000">> "instantly" switch over to a network of their choice?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> I am giving a presentation Friday at SCISA in SC, and I want to be </FONT>
<FONT COLOR="#000000">> prepared! =)</FONT>



<FONT COLOR="#000000">A crudely cobbled solution written in less than 5 lines.</FONT>

<FONT COLOR="#000000">!Please! be careful with its use.  ;-) </FONT>

<FONT COLOR="#000000">The script takes 3 items from the command line and changes all items </FONT>
<FONT COLOR="#000000">specified first with items specified second in the file specified third</FONT>

<FONT COLOR="#000000">ex call: quickhack 192.168.0 10.1.1 /etc/hosts </FONT>

<FONT COLOR="#000000">The example above would change all 192.168.0 with 10.1.1 in /etc/hosts</FONT>


<FONT COLOR="#000000">#!/bin/sh</FONT>
<FONT COLOR="#000000">perl -pi -e "s/$1/$2/g" $3</FONT>


<FONT COLOR="#000000">Do with it as you will.</FONT>

<FONT COLOR="#000000">Scott</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Don't forget that you've got to do the same thing to at least /opt/ltsp/i86/etc/lts.conf, not just /etc/hosts.  Also, you've got to tweak the stuff under /etc/sysconfig/.  This is typically why I choose something like 172.16.31.0/24 or 192.168.254.0/24 from the get-go; very few people seem to think of using those ranges.  :-)<BR>
<BR>
--TP
</BODY>
</HTML>