2007-06-20 22:05:15 +00:00
|
|
|
#!/bin/sh
|
2007-11-04 15:12:08 +00:00
|
|
|
# Copyright (C) 2007 OpenWrt.org
|
2007-06-20 22:05:15 +00:00
|
|
|
logger "usb device is mass storage"
|
2007-11-04 15:12:08 +00:00
|
|
|
i=0
|
2007-06-20 22:05:15 +00:00
|
|
|
while [ $i -le 10 ]; do
|
2007-11-04 15:12:08 +00:00
|
|
|
logger "waiting on usb drive $i ..."
|
2007-06-20 22:05:15 +00:00
|
|
|
i=$(($i+1))
|
|
|
|
cd /sys${DEVPATH}
|
2007-11-04 15:12:08 +00:00
|
|
|
for blk in `find host* -type d 2>/dev/null`; do
|
2008-09-08 09:30:57 +00:00
|
|
|
[ -d /sys/${DEVPATH}/${blk}/block/ ] && {
|
|
|
|
cd
|
|
|
|
for disc in `find /sys/${DEVPATH}/${blk}/block -name sd*`; do
|
|
|
|
sleep 2
|
|
|
|
cd $disc
|
|
|
|
for node in `find . -name sd* | cut -d "/" -f2`; do
|
|
|
|
echo "mounting /dev/${node} on /mnt/usbdrive"
|
|
|
|
mkdir -p /mnt/usbdrive
|
|
|
|
mount /dev/${node} /mnt/usbdrive
|
|
|
|
i=20
|
|
|
|
done
|
2007-06-20 22:05:15 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
done
|
|
|
|
sleep 1
|
2007-11-04 15:12:08 +00:00
|
|
|
done
|