#!/bin/sh - # # pccard_ether_remove interfacename # # example: pccard_ether_remove ep0 # # $Id: pccard_ether_remove,v 1.1.1.1.10.5 1998/12/25 01:12:06 hosokawa Exp $ # Mar 9, 1996 by Hajimu UMEMOTO # Mar 31, 1997 by Tatsumi Hosokawa # Suck in the /etc/rc.conf variables if [ -f /etc/rc.conf ]; then . /etc/rc.conf fi interface=$1 if [ "x$pccard_ether" != "xNO" ]; then eval ifconfig_args=\$ifconfig_${interface} if [ "x$ifconfig_args" = "xDHCP" ]; then if [ -s /var/run/dhclient.pid ]; then kill `cat /var/run/dhclient.pid` rm -f /var/run/dhclient.pid elif [ -s /var/run/dhcpc.$interface.pid ]; then kill `cat /var/run/dhcpc.$interface.pid` rm -f /var/run/dhcpc.$interface.pid else killarg=`ps x | awk '$5 ~/(^|\/)dhc(pc|lient)$/ && $6 ~/^'$1'$/ {print $1}'` if [ "x$killarg" != "x" ] ; then kill $killarg fi fi else # Delelte static route if specified eval ifx_routes=\$static_routes_${interface} if [ -n "$ifx_routes" ]; then for i in ${ifx_routes}; do eval route_args=\$route_${i} route delete ${route_args} done fi # Delete aliases if exist alias=0 while : do eval ifx_args=\$ifconfig_${interface}_alias${alias} if [ -n "$ifx_args" ]; then ifconfig $interface $ifx_args alias delete alias=`expr ${alias} + 1` else break; fi done ifconfig $interface delete arp -d -a fi fi # Clean the routing table # $route_flush==YES || $defaultrouter!=NO || $static_routes!=NULL [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] && route_flush="YES" [ "x${static_routes}" != "x" ] && route_flush="YES" if [ -n "$route_flush" -a "x$route_flush" != "xNO" ]; then route -n flush arp -d -a fi