#!/bin/sh

# Invoked by the device watcher when a network card is added
#

VERBOSE=false

DRIVER=`echo $2 | awk -F / '{print $4}'`

# When the ether driver publishes correctly remove ether exit
if [ $DRIVER = "ether" ]
then
	exit 0
fi

if [ "$DRIVER" = "api" ]
then
	exit 0
fi


if [ "$1x" = "addedx" ]
then
	ifconfig $2 up
	if [ $VERBOSE = "true" ]
	then
		alert "PCMCIA interface $2 online" &
	fi
	exit 0
fi

if [ "$1x" = "removedx" ]
then
	ifconfig $2 down
	if [ $VERBOSE = "true" ]
	then
		alert "PCMCIA interface $2 offline" &
	fi
	exit 0
fi
