#!/bin/sh
# $Id: testmii,v 1.4 2002/03/10 08:15:48 andrew Exp $
#
# by Andrew McMillan, Catalyst IT Ltd, (c) 2001 licensed
# for use under the GPL version 2
#

# Turn on execution tracing, for debugging...
[ "$DEBUGWHEREAMI" = "1" ] && set -o xtrace

/sbin/mii-tool $1 2>&1 | grep "link ok" >/dev/null && exit 0

# Interface is not connected - bring it down to remove it from
# routing table
ifconfig $1 down

exit 1

