pccard_ether revision 38738
1#!/bin/sh - 2# 3# $Id:$ 4# 5# pccard_ether interfacename [ifconfig option] 6# 7# example: pccard_ether ep0 -link0 8# 9 10# Suck in the /etc/rc.conf variables 11if [ -f /etc/rc.conf ]; then 12 . /etc/rc.conf 13fi 14 15if [ "x$pccard_ifconfig" != "xNO" ] ; then 16 if [ "x$pccard_ifconfig" = "xDHCP" ] ; then 17 if [ -f /usr/local/sbin/dhclient ] ; then 18 if [ -s /var/run/dhclient.pid ] ; then 19 kill `cat /var/run/dhclient.pid` 20 rm /var/run/dhclient.pid 21 fi 22 /usr/local/sbin/dhclient 23 elif [ -f /usr/local/sbin/dhcpc ] ; then 24 if [ -s /var/run/dhcpc.pid ] ; then 25 kill `cat /var/run/dhcpc.pid` 26 rm /var/run/dhcpc.pid 27 fi 28 /usr/local/sbin/dhcpc $* 29 else 30 echo "DHCP client software not available (isc-dhcp2)" 31 fi 32 else 33 interface=$1 34 shift 35 ifconfig $interface $pccard_ifconfig $* 36 fi 37fi 38 39if [ "x$defaultrouter" != "xNO" ] ; then 40 static_routes="default ${static_routes}" 41 route_default="default ${defaultrouter}" 42fi 43 44# Set up any static routes. 45if [ "x${static_routes}" != "x" ]; then 46 # flush beforehand, just in case.... 47 route -n flush 48 arp -d -a 49 for i in ${static_routes}; do 50 eval route_args=\$route_${i} 51 route add ${route_args} 52 done 53fi 54