Re: How to programmatically detect a mounted device



On 9 Apr 2007 12:31:57 -0700
"Podi" <podi.ex@xxxxxxxxx> wrote:

My question is: how can I programmatically detect whether or
not a MMC card is mounted?


Here is a little /bin/sh routine that you probably might find
useful, or can modify to suit...

is_reader() {
test=$( cat /proc/scsi/usb-storage*/* 2> /dev/null | grep
"Card Reader"; cat /proc/bus/usb/devices 2> /dev/null |
grep Cnt=0[1-9] ) if [ "$test" = "" ]; then
return 0
else
return 1
fi
}

TonyB


There are 10 types of people in this world, those that read
binary and those who don't!

--
__ __ _ I N C. http://www.sysdev.org
/ __|\\// __|| \ __ __ / tonyb@xxxxxxxxxx
\__ \ \/\__ \||)|/ O_)\/ / \/ System Tools / Utilities
|___/ || ___/|_ /\___|\_/ WIntel / Linux Device Drivers

.