=========================================== README for "where2-9.sh" shell script =========================================== PURPOSE OF SCRIPT A portable PC typically needs to operate in multiple networking environments, e.g. home, office, remote dial-up. Each of these environments has its own unique settings for hostname / hosts device IP addresses gateway device/address DNS interfaces (eth0, eth1, rfcomm0...). This script allows you to switch networking settings in two different ways: 1. Without shutting down the computer. This mode is used to switch to/from a remote dial-up setting whilst in the office or at home. Useful if the network is down. If you use this mode, you MUST return to the same environment you came from, ie. home-remote-home and office-remote-office are both OK, office-remote-home is not OK. 2. With full shutdown. This mode is required if you are moving the computer from home to office, or office to home. In that situation, it is necesary to change the hostname and IP address and a full shutdown seems to be required (at least I have not found a way of doing it "on the fly" without serious host misconfiguration..!). Please DO NOT select the remote option if you are shutting down - it will cause all kinds of problems when the computer starts up again... PRE-REQUISITES You will need to know exactly the network settings for home and office before going any further. Make sure you have a working configuration for each. Print out the contents of each of the following files, first when you are working at home, then when you are working at the office: /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf /etc/hosts Create additional versions of ALL the above files, suffixed ".home" and ".office" with the appropriate settings in each. For example, the two additional files for /etc/sysconfig/network will be: /etc/sysconfig/network.home /etc/sysconfig/network.office Move the two files you created in /etc/sysconfig/network-scripts (ifcfg-eth0.home and ifcfg-eth0.office) into a new directory named /etc/sysconfig/tmp/ Create a new file /etc/resolv.conf.remote with a single line: nameserver 127.0.0.1 (this assumes you have BIND running on your machine: if not, set the nameserver IP to 0.0.0.0) Create a new file /etc/sysconfig/network.remote containing the following lines: NETWORKING=yes HOSTNAME="enteryourhostname.yourdomain" GATEWAY=0.0.0.0 GATEWAYDEV="ppp0" You should now have all the required files. If not, you will get error messages when you run "where2-9.sh". RUNNING THE "where2-9" SCRIPT (MUST BE RUN su root) Simply cd to the directory where the script is stored, and enter: sh where2-9.sh If you have problems, make sure you have read and implemented everything above before contacting me! However, I may have missed out something important, so all feedback will be appreciated. ________________________________ Jeremy Thompson mail@jeremythompson.uklinux.net ________________________________