hw-test/scripts/watcher-badblocks

26 lines
351 B
Text
Raw Normal View History

#!/bin/bash
if [[ -z $OUTPUT_DIR ]] ; then
source scan-dmidecode
fi
RUNNING=0
while [[ $RUNNING == 0 ]] ; do
sleep 1
if [[ -f /run/badblocks.waiting ]] ; then
RUNNING=1
fi
done
sleep 5
2016-12-23 03:42:14 -06:00
tail -Fq /run/*.badblocks.out &
TAIL_PID=`jobs -p %+`
while [[ -f /run/badblocks.waiting ]] ; do
sleep 1
done
kill $TAIL_PID
2016-12-23 03:42:14 -06:00
rm -vf /run/*.badblocks.out