Code: Alles auswählen
if [ -z "$1" ]
then
echo "no device given"
exit 1
fi
echo "Scanning for bad blocks on device /dev/$1 ..."
logfile=/tmp/badblocks_$1.txt
bs=`blockdev --getbsz /dev/$1`
/sbin/badblocks -b $bs /dev/$1 -o $logfile
[ ! -f $logfile ] && { exit 0; }
if [ -s $logfile ]
then
/bin/triggerAlarm.tcl 'Bad Blocks detected on /dev/'$1 'bad blocks scan'
fi