View Single Post
Posts: 167 | Thanked: 204 times | Joined on Jul 2010
#8
The list of what's mounted is /etc/mtab, and the mmc is /dev/mmcblk1p1.

So something like

Code:
TEST=`grep -o mmcblk1p1 /etc/mtab`;
if [ ! -z "$TEST" ]; then
# do something
else
# don't do something
fi
Edited to explain:

First line sets the variable $TEST with the output of the command that's in backticks. The grep command searches for the mmcblk1p1 in the list of what's currently mounted, the -o switch says output only what matched.

Then, in shell, if that gets us a non zero length response, well, we found what we were grepping for, if not we didn't...

Last edited by magick777; 2011-09-06 at 12:17. Reason: Explanation, missing bracket
 

The Following User Says Thank You to magick777 For This Useful Post: