ifconfig.sh revision 15a44745412679c30a6d022733925af70a38b715
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#!/bin/sh
67a1122d50d24747976844db61a2c994a9b8b1e4Tinderbox User#
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence# Copyright (C) 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# purpose with or without fee is hereby granted, provided that the above
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews# copyright notice and this permission notice appear in all copies.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#
4b6dc226f78862286daa69fba761eac9fd5da16aAutomatic Updater# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
940e4ef72b64a8a82a1038fdf08b324eec6e43a9Michael Graff# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
940e4ef72b64a8a82a1038fdf08b324eec6e43a9Michael Graff# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
3761c433912beabe43abeed2c3513b6201c59f64Mark Andrews# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
6324997211a5e2d82528dcde98e8981190a35faeMichael Graff# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6324997211a5e2d82528dcde98e8981190a35faeMichael Graff
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff# $Id: ifconfig.sh,v 1.19 2000/07/27 09:39:11 tale Exp $
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews# Set up interface aliases for bind9 system tests.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman# If running on hp-ux, don't even try to run config.guess.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews# It will try to create a temporary file in the current directory,
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington# which fails when running as root with the current directory
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington# on a NFS mounted disk.
bddfe77128b0f16af263ff149db40f0d885f43d0Mark Andrews
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellingtoncase `uname -a` in
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington *HP-UX*) sys=hpux ;;
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington *) sys=`../../../config.guess` ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsesac
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrencecase "$1" in
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews 'start')
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews for ns in 1 2 3 4 5
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews do
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews case "$sys" in
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews *-sun-solaris2.[6-7])
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews ifconfig lo0:$ns 10.53.0.$ns up
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews ;;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews *-sun-solaris2.8)
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews ifconfig lo0:$ns plumb
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews ifconfig lo0:$ns 10.53.0.$ns up
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews ;;
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews *-pc-linux-gnu)
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews ifconfig lo:$ns 10.53.0.$ns up
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-unknown-freebsdelf3.4)
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff ifconfig lo0 10.53.0.$ns alias
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-unknown-freebsdelf4.0)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 10.53.0.$ns alias netmask 0xffffffff
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-unknown-netbsd*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 10.53.0.$ns alias
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman ;;
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrews *-pc-bsdi3.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 add 10.53.0.$ns
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-dec-osf5.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews /sbin/ifconfig lo0 alias 10.53.0.$ns
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-dec-osf4.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews /sbin/ifconfig lo0 alias 10.53.0.$ns
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-pc-bsdi4.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 add 10.53.0.$ns
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-sgi-irix6.*)
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff ifconfig lo0 alias 10.53.0.$ns
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence ;;
4b6dc226f78862286daa69fba761eac9fd5da16aAutomatic Updater *-ibm-aix4.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 alias 10.53.0.$ns
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman ;;
1ef8965366d91e02a4672c35a187d30aa4a4c72cMark Andrews hpux)
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington ifconfig lo0:$ns 10.53.0.$ns up
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington ;;
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington *)
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson echo "Don't know how to set up interface. Giving up."
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence exit 1
4b6dc226f78862286daa69fba761eac9fd5da16aAutomatic Updater esac
4b6dc226f78862286daa69fba761eac9fd5da16aAutomatic Updater done
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff 'stop')
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence for ns in 5 4 3 2 1
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews do
cdc50af0bff41accc02c613b9c6d8cd41b171ffeBrian Wellington case "$sys" in
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-sun-solaris2.[6-7])
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0:$ns 10.53.0.$ns down
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman ;;
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrews *-sun-solaris2.8])
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0:$ns 10.53.0.$ns down
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson ;;
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews *-pc-linux-gnu)
cdc50af0bff41accc02c613b9c6d8cd41b171ffeBrian Wellington ifconfig lo:$ns 10.53.0.$ns down
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-unknown-freebsdelf3.4)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 10.53.0.$ns delete
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-unknown-freebsdelf4.0)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 10.53.0.$ns delete
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halley ;;
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence *-unknown-netbsd*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 10.53.0.$ns delete
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-pc-bsdi3.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 remove 10.53.0.$ns
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews *-dec-osf5.*)
d981ca645597116d227a48bf37cc5edc061c854dBob Halley ifconfig lo0 -alias 10.53.0.$ns
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman ;;
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrews *-dec-osf4.*)
b589e90689c6e87bf9608424ca8d99571c18bc61Mark Andrews ifconfig lo0 -alias 10.53.0.$ns
f7b99290c31abeb20c55fc55391510450ce60423Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-pc-bsdi4.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 remove 10.53.0.$ns
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-sgi-irix6.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 -alias 10.53.0.$ns
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *-ibm-aix4.*)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0 delete 10.53.0.$ns
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews hpux)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ifconfig lo0:$ns 10.53.0.$ns down
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews ;;
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff *)
6d12fdf96621801e80f3f4c2a8a569fe48766a20David Lawrence echo "Don't know how to destroy interface. Giving up."
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews exit 1
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews esac
82ca33427bdd4f3bc4ed3431e86bd810fe751674Andreas Gustafsson done
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews ;;
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews *)
f7b99290c31abeb20c55fc55391510450ce60423Mark Andrews echo "Usage: $0 {start|stop}"
ae114ded82e773a4d9058f833f964a17514712a8Brian Wellington exit 1
63cef8bde8b92aeb30ccdcf21d4e44c9be9cc6e3Andreas Gustafssonesac
63cef8bde8b92aeb30ccdcf21d4e44c9be9cc6e3Andreas Gustafsson