kexec-tools/kdump_runtime_helpers/wait_for_critical_disks

37 lines
498 B
Plaintext
Raw Normal View History

2009-05-14 20:09:31 +00:00
#!/bin/msh
#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