blob: 45490e51410b491b78e321b417af36cf3c9f65c9 [file] [log] [blame]
#!/bin/sh /etc/rc.common
# Marvell sd card detect & mount script
# Change by mbtk
START=10
STOP=91
WEBDAV_SD=/www/webdav/sdcard
start() {
/sbin/block detect > /etc/config/fstab
uci show fstab.@mount[0]
if [ $? -eq 0 ]; then
fstype=`uci get fstab.@mount[0].fstype`
[ "$fstype" == "vfat" ] && {
uci set fstab.@mount[0].options='utf8=1'
uci_commit fstab
}
fi
/sbin/block mount
. /sbin/mrvl_detect_sdcard
touch /tmp/sdcard_mount
uci show fstab.@mount[0]
if [ $? -eq 0 ]; then
mkdir -p $WEBDAV_SD
mount --bind /sdcard $WEBDAV_SD
else
rm -rf /www/webdav/sdcard/ 2>/dev/null
fi
if [ -e "/NVM/sulog_auto_enable" ]; then
/bin/sulog &
sleep 1
/bin/serial_atcmd "AT*IMLCONFIG=5,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
fi
}
stop() {
/sbin/block umount
/sbin/block detect > /etc/config/fstab
uci delete fstab.@mount[0]
uci commit fstab
umount $WEBDAV_SD 2>/dev/null
}