pccard_ether revision 63308
1#!/bin/sh -
2#
3# $FreeBSD: head/etc/pccard_ether 63308 2000-07-17 12:33:57Z ume $
4#
5# pccard_ether interfacename [ifconfig option]
6#
7# example: pccard_ether ep0 -link0
8#
9
10# Suck in the configuration variables
11#
12if [ -r /etc/defaults/rc.conf ]; then
13	. /etc/defaults/rc.conf
14	source_rc_confs
15elif [ -r /etc/rc.conf ]; then
16	. /etc/rc.conf
17fi
18
19interface=$1
20shift
21
22case ${pccard_ifconfig} in
23[Nn][Oo] | '')
24        ;;
25[Dd][Hh][Cc][Pp])
26	if [ -r /sbin/dhclient ]; then
27		if [ -s /var/run/dhclient.pid ]; then
28			kill `cat /var/run/dhclient.pid`
29			rm /var/run/dhclient.pid
30		fi
31		/sbin/dhclient $interface
32	elif [ -r /usr/local/sbin/dhcpc ]; then
33		if [ -s /var/run/dhcpc.pid ]; then
34			kill `cat /var/run/dhcpc.pid`
35			rm /var/run/dhcpc.pid
36		fi
37		/usr/local/sbin/dhcpc $interface $*
38	else
39		echo "DHCP client software not available (isc-dhcp2)"
40	fi
41	;;
42*)
43	ifconfig ${interface} ${pccard_ifconfig} $*
44	;;
45esac
46
47case ${defaultrouter} in
48[Nn][Oo] | '')
49        ;;
50*)
51	static_routes="default ${static_routes}"
52	route_default="default ${defaultrouter}"
53	;;
54esac
55
56# Set up any static routes.
57#
58if [ -n "${static_routes}" ]; then
59	# flush beforehand, just in case....
60        route -n flush
61	arp -d -a
62	for i in ${static_routes}; do
63		eval route_args=\$route_${i}
64		route add ${route_args}
65	done
66fi
67
68# IPv6 setup
69case ${ipv6_enable} in
70[Yy][Ee][Ss])
71	case ${ipv6_gateway_enable} in
72	[Yy][Ee][Ss])
73		;;
74	*)
75		ifconfig ${interface} up
76		rtsol ${interface}
77		;;
78	esac
79	;;
80esac
81