pccard_ether revision 57144
1139823Simp#!/bin/sh - 254263Sshin# 354263Sshin# $FreeBSD: head/etc/pccard_ether 57144 2000-02-11 14:49:42Z nsayer $ 454263Sshin# 554263Sshin# pccard_ether interfacename [ifconfig option] 654263Sshin# 754263Sshin# example: pccard_ether ep0 -link0 854263Sshin# 954263Sshin 1054263Sshin# Suck in the configuration variables 1154263Sshin# 1254263Sshinif [ -r /etc/defaults/rc.conf ]; then 1354263Sshin . /etc/defaults/rc.conf 1454263Sshinelif [ -r /etc/rc.conf ]; then 1554263Sshin . /etc/rc.conf 1654263Sshinfi 1754263Sshin 1854263Sshininterface=$1 1954263Sshinshift 2054263Sshin 2154263Sshincase ${pccard_ifconfig} in 2254263Sshin[Nn][Oo] | '') 2354263Sshin ;; 2454263Sshin[Dd][Hh][Cc][Pp]) 2554263Sshin if [ -r /sbin/dhclient ]; then 2654263Sshin if [ -s /var/run/dhclient.pid ]; then 2754263Sshin kill `cat /var/run/dhclient.pid` 28273087Sae rm /var/run/dhclient.pid 29273087Sae fi 3054263Sshin /sbin/dhclient $interface 3154263Sshin elif [ -r /usr/local/sbin/dhcpc ]; then 32172467Ssilby if [ -s /var/run/dhcpc.pid ]; then 33172467Ssilby kill `cat /var/run/dhcpc.pid` 34172467Ssilby rm /var/run/dhcpc.pid 3562587Sitojun fi 3654263Sshin /usr/local/sbin/dhcpc $interface $* 3754263Sshin else 3854263Sshin echo "DHCP client software not available (isc-dhcp2)" 39273087Sae fi 40273087Sae ;; 4154263Sshin*) 4254263Sshin ifconfig ${interface} ${pccard_ifconfig} $* 4354263Sshin ;; 4454263Sshinesac 4554263Sshin 4654263Sshincase ${defaultrouter} in 4754263Sshin[Nn][Oo] | '') 48105293Sume ;; 4962587Sitojun*) 5062587Sitojun static_routes="default ${static_routes}" 5154263Sshin route_default="default ${defaultrouter}" 52257176Sglebius ;; 5354263Sshinesac 54196019Srwatson 5554263Sshin# Set up any static routes. 5654263Sshin# 5754263Sshinif [ -n "${static_routes}" ]; then 5854263Sshin # flush beforehand, just in case.... 5954263Sshin route -n flush 6062587Sitojun arp -d -a 6162587Sitojun for i in ${static_routes}; do 6255009Sshin eval route_args=\$route_${i} 6362587Sitojun route add ${route_args} 6454263Sshin done 6562587Sitojunfi 6654263Sshin