#!/bin/sh
#
# pcmcia control script - by Matthew Franz (mdfranz@io.com)
# for Trinux: A Linux Security Toolkit
#
#	usage:
#              pcmcia [start | stop ]
#	       defaults to start
#
#


if [ "$1"="stop" ]
then
	ifconfig eth0 down
	killall cardmgr
	if rmmod ds 
	then
		rmmod i82365 
		rmmod pcmcia_core
	else
		lsmod
		echo "Please remove your NIC module with the rmmod [module] command"	
		echo "and execute again"
	fi

elif [ "$1" = "start" ]
then
	insmod pcmcia_core
	insmod i82365
	insmod ds
	cardmgr
	sleep 6
	netcfg
else
	echo "Usage:"
	echo '       pcmcia {start|stop}'
fi   
