M7350/oe-core/meta-msm/recipes/busybox/files/automountsdcard.sh

22 lines
322 B
Bash
Raw Normal View History

2024-09-09 08:52:07 +00:00
#! /bin/sh
if [ "$1" == "" ]; then
exit 1
fi
mmcblk=`ls /dev | grep $1 | wc -l`
mounted=`mount | grep $1 | wc -l`
if [ $mmcblk -ge 1 ]; then
if [ $mounted -le 0 ]; then
mount /dev/$1 /media/card
fi
fi
if [ $mmcblk -le 0 ]; then
if [ $mounted -ge 0 ]; then
umount /media/card
fi
fi