2009-05-20 16:42:31 +00:00
|
|
|
#!/bin/sh
|
2009-05-14 20:09:31 +00:00
|
|
|
#kdump-requires: /etc/critical-disks
|
|
|
|
|
|
|
|
echo "Waiting for critical disks"
|
|
|
|
|
|
|
|
TIMEOUT_COUNT=""
|
|
|
|
|
|
|
|
if [ -n "$1" ]
|
|
|
|
then
|
|
|
|
TIMEOUT_COUNT=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
let COUNT=0
|
|
|
|
|
|
|
|
for i in `cat /etc/critical_disks`
|
|
|
|
do
|
|
|
|
echo -n "Waiting for" $i "..."
|
|
|
|
while [ ! -d $i ]
|
|
|
|
do
|
|
|
|
sleep 1
|
|
|
|
if [ -n "$TIMEOUT_COUNT" ]
|
|
|
|
then
|
|
|
|
if [ "$TIMEOUT_COUNT" == "$COUNT" ]
|
|
|
|
then
|
|
|
|
echo "Timeout waiting for disks, continuing..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
let COUNT=$COUNT+1
|
|
|
|
done
|
|
|
|
echo "Found" $i
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Found all disks"
|
|
|
|
exit 0
|
|
|
|
|