Suggestion for the clear_an_array_drive script
change
for d in /mnt/disk[1-9]*
do
x=`ls -A $d`
z=`du -s $d`
y=${z:0:1}
# echo -e "d:"$d "x:"${x:0:20} "y:"$y "z:"$z
# the test for marker and emptiness
if [ "$x" == "$marker" -a "$y" == "0" ]
then
found=1
break
fi
let n=n+1
done
to
for d in /mnt/disk[1-9]*
do
x=`ls -A $d`
# echo -e "d:"$d "x:"${x:0:20}
# the test for marker
if [ "$x" == "$marker" ]
then
z=`du -s $d`
y=${z:0:1}
# echo -e "d:"$d "x:"${x:0:20} "y:"$y "z:"$z
# the test for marker and emptiness
if [ "$x" == "$marker" -a "$y" == "0" ]
then
found=1
break
fi
fi
let n=n+1
done
This will prevent lengthy emptyness checks on disks without the clear-me marker.