pccard_ether revision 31760
1310490Scy#!/bin/sh - 2310490Scy# 338494Sobrien# pccard_ether interfacename [ifconfig option] 4310490Scy# 5310490Scy# example: pccard_ether ep0 -link0 638494Sobrien# 7310490Scy 8310490Scy# Suck in the /etc/rc.conf variables 9310490Scyif [ -f /etc/rc.conf ]; then 10310490Scy . /etc/rc.conf 1138494Sobrienfi 12310490Scy 13310490Scyif [ "x$pccard_ifconfig" != "xNO" ] ; then 14174294Sobrien if [ "x$pccard_ifconfig" = "xDHCP" ] ; then 15310490Scy if [ -f /usr/local/sbin/dhclient ] ; then 16310490Scy if [ -s /var/run/dhclient.pid ] ; then 17310490Scy kill `cat /var/run/dhclient.pid` 18310490Scy rm /var/run/dhclient.pid 19310490Scy fi 20310490Scy /usr/local/sbin/dhclient 21310490Scy fi 22310490Scy else 2338494Sobrien interface=$1 24310490Scy shift 25310490Scy ifconfig $interface $pccard_ifconfig $* 26310490Scy fi 27310490Scyfi 28310490Scy 29310490Scyif [ "x$defaultrouter" != "xNO" ] ; then 30310490Scy static_routes="default ${static_routes}" 31310490Scy route_default="default ${defaultrouter}" 3238494Sobrienfi 33310490Scy 34310490Scy# Set up any static routes. 35310490Scyif [ "x${static_routes}" != "x" ]; then 36310490Scy # flush beforehand, just in case.... 37310490Scy route -n flush 3838494Sobrien arp -d -a 39310490Scy for i in ${static_routes}; do 40310490Scy eval route_args=\$route_${i} 41310490Scy route add ${route_args} 42310490Scy done 43310490Scyfi 44310490Scy