]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/pccard_ether
Typos, missing words. I don't believe any of these are relevant to
[FreeBSD/FreeBSD.git] / etc / pccard_ether
1 #!/bin/sh -
2 #
3 # $FreeBSD$
4 #
5 # pccard_ether interfacename [ifconfig option]
6 #
7 # example: pccard_ether ep0 -link0
8 #
9
10 # Suck in the configuration variables
11 #
12 if [ -r /etc/defaults/rc.conf ]; then
13         . /etc/defaults/rc.conf
14         source_rc_confs
15 elif [ -r /etc/rc.conf ]; then
16         . /etc/rc.conf
17 fi
18
19 interface=$1
20 shift
21
22 case ${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         ;;
45 esac
46
47 case ${defaultrouter} in
48 [Nn][Oo] | '')
49         ;;
50 *)
51         static_routes="default ${static_routes}"
52         route_default="default ${defaultrouter}"
53         ;;
54 esac
55
56 # Set up any static routes.
57 #
58 if [ -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
66 fi