summaryrefslogtreecommitdiff
path: root/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
diff options
context:
space:
mode:
Diffstat (limited to 'packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling')
-rwxr-xr-xpackages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling23
1 files changed, 18 insertions, 5 deletions
diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
index ce2e528c92..bed1789a6f 100755
--- a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
+++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
@@ -11,9 +11,11 @@ fi
if [ $# -eq 1 ] ; then
if [ "$1" = "disk1" ] ; then
+ mtch="/dev/sdb1 /share/hdd/data ext3 rw 0 0"
targ=/share/hdd/data
flag=.sda1root
elif [ "$1" = "disk2" ] ; then
+ mtch="/dev/sda1 /share/flash/data ext3 rw 0 0"
targ=/share/flash/data
flag=.sdb1root
else
@@ -27,11 +29,22 @@ fi
# Check it's a real mount point
-if grep $targ /proc/mounts >/dev/null 2>&1 ; then
- echo "Target disk is $targ"
-else
- echo "Error: $targ is not a mounted disk"
- exit 1
+echo "Waiting for $targ"
+CNT=120
+while [ $CNT -gt 0 ]
+do
+ if grep "$mtch" /proc/mounts >/dev/null 2>&1 ; then
+ echo "Target disk is $targ"
+ CNT=-1
+ else
+ echo -ne "\r$CNT "
+ sleep 1
+ CNT=`expr $CNT - 1`
+ fi
+done
+if [ $CNT -eq 0 ] ; then
+ echo "Error: $targ is not a mounted disk"
+ exit 1
fi
# Start at the root directory