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