Subject: [os2genau_digest] No. 314
From: Digest <deadmail>
To: "OS/2GenAu Digest" <deadmail>
Date: Sun, 7 Apr 2002 00:00:04 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600

**************************************************
Saturday 06 April 2002
 Number  314
**************************************************

Subjects for today
 
1  Re: [os2genau] TCPIP questions : David Forrester" <davidforatterrigal dot net dot au>

**= Email   1 ==========================**

Date:  Sat, 06 Apr 2002 22:39:03 +1000 (EST)
From:  "David Forrester" <davidforatterrigal dot net dot au>
Subject:  Re: [os2genau] TCPIP questions

On Fri, 05 Apr 2002 10:13:28 +1100 (EDT), Dr Graham Norton FRACP
Neurologist wrote:

>Hi to all the guru s out there...
>
>can anyone  help me and educate me about...
>
>1	I want to be able to change the TCPIP setup to reflect whether i  am either at work  or at home....  obviously 
>there is a ini file 
>or some such that  is modified ... I wonder if I cant have 2 TCPIP set up files  
>
>	a	home
>	b `	LAN at work
>
>and then use a batch file routine to xcopy  either one to the what ever file it is called   (???PIP.ini  )   eg  xcopy 
>X:\home.ini 
>c:\TCPIP\setup.ini.... or what ever the name of the file is??  do you understand?
>
>so that at the end of the day at work , I can xcopy the file across and then reboot at home and log onto the internet 
>(ADSL) at home and then at the end of the night or weekend xcopy the LAN settings and reboot at work... sounds 
>simple !
>

Below is the bit of REXX I use for exactly this.  At work we use DHCP,
at home I have four machines plus my laptop with fixed addresses.  As
others have said, I could use DHCP at home, but, it feels like overkill
for the size of the network.

To use it, configure the network for one of the places.  Run "SwapTCPIP
place1 SAVE" where place1 is the name you want to use later.  Then,
configure the other network for the other place and run it again with
"SwapTCPIP place2 SAVE".  Then you can swap at will with "SwapTCPIP
place2" or "SwapTCPIP place1".  If you want to change settings without
shutting down, you can add the parameter "EXECUTE" to run SETUP.CMD.

/* Swap the TCPIP configuration between home and work. */
Trace 'Off'

Parse Upper Arg direction execute .

files.1 = 'C:\MPTN\ETC\RESOLV2'
files.2 = 'C:\MPTN\ETC\HOSTS'
files.3 = 'C:\MPTN\BIN\SETUP.CMD'
files.4 = 'C:\MPTN\ETC\pinghost.lst'
files.5 = 'C:\IBMLAN\IBMLAN.INI'
files.0 = 5

execute = Strip(execute)
direction = Strip(direction)
If direction = 'EXECUTE' Then Do
   execute   = direction
   direction = ''
End /* If .. Then Do */
Else If direction = '' Then direction = 'WORK'

If execute = 'SAVE' Then /* Saving a new set. */
   Do
      Do i = 1 to files.0
      'COPY' files.i files.i|| '.' || direction
      End /* Do .. To .. */
   End /* If .. Then Do */
Else If direction <> '' Then Do
   Do i = 1 to files.0
      'COPY' files.i || '.' || direction files.i
   End /* Do .. To .. */
End /* Else If .. Then Do */

If execute = 'EXECUTE' Then
Do
  'Call C:\MPTN\BIN\SETUP.CMD'
End /* If .. Then Do */

Exit

--
David Forrester
davidforatterrigal dot net dot au
http://www.os2world dot com/djfos2/

----------------------------------------------------------------------------------