pccard_ether revision 31760
1#!/bin/sh -
2#
3# pccard_ether interfacename [ifconfig option]
4#
5# example: pccard_ether ep0 -link0
6#
7
8# Suck in the /etc/rc.conf variables
9if [ -f /etc/rc.conf ]; then
10	. /etc/rc.conf
11fi
12
13if [ "x$pccard_ifconfig" != "xNO" ] ; then
14	if [ "x$pccard_ifconfig" = "xDHCP" ] ; then
15		if [ -f /usr/local/sbin/dhclient ] ; then
16		    if [ -s /var/run/dhclient.pid ] ; then
17			kill `cat /var/run/dhclient.pid`
18			rm /var/run/dhclient.pid
19		    fi
20		    /usr/local/sbin/dhclient
21		fi
22	else
23		interface=$1
24		shift
25		ifconfig $interface $pccard_ifconfig $*
26	fi
27fi
28
29if [ "x$defaultrouter" != "xNO" ] ; then
30	static_routes="default ${static_routes}"
31	route_default="default ${defaultrouter}"
32fi
33    
34# Set up any static routes.
35if [ "x${static_routes}" != "x" ]; then
36	# flush beforehand, just in case....
37        route -n flush
38	arp -d -a
39	for i in ${static_routes}; do
40		eval route_args=\$route_${i}
41		route add ${route_args}
42	done
43fi
44