pccard_ether revision 38312
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		elif [ -f /usr/local/sbin/dhcpc ] ; then
22		    if [ -s /var/run/dhcpc.pid ] ; then
23		        kill `cat /var/run/dhcpc.pid`
24		        rm /var/run/dhcpc.pid
25		    fi
26		    /usr/local/sbin/dhcpc $* 
27		else
28		    echo "DHCP client software not available (isc-dhcp2)"
29		fi
30	else
31		interface=$1
32		shift
33		ifconfig $interface $pccard_ifconfig $*
34	fi
35fi
36
37if [ "x$defaultrouter" != "xNO" ] ; then
38	static_routes="default ${static_routes}"
39	route_default="default ${defaultrouter}"
40fi
41    
42# Set up any static routes.
43if [ "x${static_routes}" != "x" ]; then
44	# flush beforehand, just in case....
45        route -n flush
46	arp -d -a
47	for i in ${static_routes}; do
48		eval route_args=\$route_${i}
49		route add ${route_args}
50	done
51fi
52