summaryrefslogtreecommitdiffstats
path: root/etc/pccard_ether
blob: 2bc3a192b3a59f4310b174f1f35ddab773d845ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh -
#
# $FreeBSD$
#
# pccard_ether interfacename [ifconfig option]
#
# example: pccard_ether ep0 -link0
#

# Suck in the configuration variables
#
if [ -r /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
elif [ -r /etc/rc.conf ]; then
	. /etc/rc.conf
fi

case ${pccard_ifconfig} in
[Nn][Oo] | '')
        ;;
[Dd][Hh][Cc][Pp])
	if [ -r /sbin/dhclient ]; then
		if [ -s /var/run/dhclient.pid ]; then
			kill `cat /var/run/dhclient.pid`
			rm /var/run/dhclient.pid
		fi
		/sbin/dhclient
	elif [ -r /usr/local/sbin/dhcpc ]; then
		if [ -s /var/run/dhcpc.pid ]; then
			kill `cat /var/run/dhcpc.pid`
			rm /var/run/dhcpc.pid
		fi
		/usr/local/sbin/dhcpc $*
	else
		echo "DHCP client software not available (isc-dhcp2)"
	fi
	;;
*)
	interface=$1
	shift
	ifconfig ${interface} ${pccard_ifconfig} $*
	;;
esac

case ${defaultrouter} in
[Nn][Oo] | '')
        ;;
*)
	static_routes="default ${static_routes}"
	route_default="default ${defaultrouter}"
	;;
esac

# Set up any static routes.
#
if [ -n "${static_routes}" ]; then
	# flush beforehand, just in case....
        route -n flush
	arp -d -a
	for i in ${static_routes}; do
		eval route_args=\$route_${i}
		route add ${route_args}
	done
fi
OpenPOWER on IntegriCloud