#!/bin/sh -
#
# pccardetherstop interfacename
#
# example: pccardetherstop nep0
#
# Mar 9, 1996 by Hajimu UMEMOTO <ume@calm.imasy.or.jp>

# Suck in the /etc/sysconfig variables
if [ -f /etc/sysconfig ]; then
	. /etc/sysconfig
fi

interface=$1

if [ "x$pccard_ether" != "xNO" ] ; then
	eval ifconfig_args=\$ifconfig_${interface}
	if [ "x$ifconfig_args" = "xDHCP" ] ; then
		kill `ps x | awk '$5 ~/(^|\/)dhcpc$/ && $6 ~/^'$1'$/ {print $1}'`
	else
		ifconfig $interface delete
	fi
fi

if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
	route -n flush
fi
