37 lines
498 B
Plaintext
37 lines
498 B
Plaintext
|
#!/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
|
||
|
|