#!/bin/sh #----------------------------------------------------------------------------- # system-devices-mount-usb - mount usb device # Copyright (c) 2001-2013 The Eisfair Team #----------------------------------------------------------------------------- mountpath='/media/usb' option='vfat' echo "" if [ -e /proc/scsi/usb-storage -a -n "$(ls /proc/scsi/usb-storage 2>/dev/null)" ] ; then for a in sda sdb sdc sdd sde sdf sdg sdh sdi sdj sdk sdl sdm sdn sdo do found="0" # if mounted? if [ -n "`mount | grep "^/dev/${a} "`" ] ; then found="1" else if [ -e /proc/mdstat ] ; then if grep -q " ${a}" /proc/mdstat ; then found="1" fi fi fi dev="/dev/${a}1" if [ "$found" = "0" -a -e ${dev} ] ; then mount -t ${option} ${dev} ${mountpath} if [ $? = 0 ] ; then /var/install/bin/ask.cui --info "mount successful with option $option, path is $mountpath." exit 0 fi fi done fi /var/install/bin/ask.cui --error "No usb storage found" exit 0