#! /bin/sh
#
# network.sample $Revision: 1.1 $ $Date: 1995/05/25 04:30:06 $ (David Hinds)
#
# Initialize or shutdown a PCMCIA ethernet adapter
#
# This script should be invoked with two arguments.  The first is the
# action to be taken, either "start", "stop", or "restart".  The
# second is the network interface name.

action=$1
device=$2

# Edit for your setup.
IPADDR="36.103.0.37"	# REPLACE with YOUR IP address!
NETMASK="255.255.255.0"	# REPLACE with YOUR netmask!
NETWORK="36.103.0.0"	# REPLACE with YOUR network address!
BROADCAST="36.103.255.255"	# REPLACE with YOUR broadcast address, if you
			# have one. If not, leave blank and edit below.
GATEWAY="36.103.0.1"	# REPLACE with YOUR gateway address!

case "${action:?}" in
'start')
    /sbin/ifconfig ${device:?} up ${IPADDR} broadcast ${BROADCAST} \
        netmask ${NETMASK}
    /sbin/route add -net ${NETWORK} netmask ${NETMASK}
    /sbin/route add default gw ${GATEWAY} metric 1
    ;;
'stop')
    /sbin/route del default
    /sbin/route del ${NETWORK}
    /sbin/ifconfig ${device:?} down
    ;;
'restart')
    /sbin/ifconfig ${device:?} down up
    ;;
esac
