pccard_ether revision 51231
1#!/bin/sh - 2# 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 11# 12if [ -r /etc/defaults/rc.conf ]; then 13 . /etc/defaults/rc.conf 14elif [ -r /etc/rc.conf ]; then 15 . /etc/rc.conf 16fi 17 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 24 kill `cat /var/run/dhclient.pid` 25 rm /var/run/dhclient.pid 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 35 echo "DHCP client software not available (isc-dhcp2)" 36 fi 37 ;; 38*) 39 interface=$1 40 shift 41 ifconfig ${interface} ${pccard_ifconfig} $* 42 ;; 43esac 44 45case ${defaultrouter} in 46[Nn][Oo] | '') 47 ;; 48*) 49 static_routes="default ${static_routes}" 50 route_default="default ${defaultrouter}" 51 ;; 52esac 53 54# Set up any static routes. 55# 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 65