[K12OSN] command to change the private network settings for K12LTSP

Terrell Prudé, Jr. microman at cmosnetworks.com
Fri Nov 4 02:18:28 UTC 2005


On Wed, 2005-11-02 at 10:54 -0500, Scott Sherrill wrote:

> Henry Burroughs wrote:
> 
> > Is there a script to change all the private network settings 
> > (/etc/hosts, lts.conf, and other files)?  That way if someone is 
> > trying to deploy it already on a 192.168.0.* network, they can 
> > "instantly" switch over to a network of their choice?
> >
> > I am giving a presentation Friday at SCISA in SC, and I want to be 
> > prepared! =)
> 
> 
> 
> A crudely cobbled solution written in less than 5 lines.
> 
> !Please! be careful with its use.  ;-) 
> 
> The script takes 3 items from the command line and changes all items 
> specified first with items specified second in the file specified third
> 
> ex call: quickhack 192.168.0 10.1.1 /etc/hosts 
> 
> The example above would change all 192.168.0 with 10.1.1 in /etc/hosts
> 
> 
> #!/bin/sh
> perl -pi -e "s/$1/$2/g" $3
> 
> 
> Do with it as you will.
> 
> Scott


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.  :-)

--TP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/k12osn/attachments/20051103/95428a85/attachment.htm>


More information about the K12OSN mailing list