#!/bin/bash
# Well, this test isn't quite living up to its name, but it does handle
# S.M.A.R.T. data.

smartctl=smartctl

$smartctl -c /dev/$1 | grep -qE '(S.M.A.R.T. Passed)|(S.M.A.R.T. Sense: Okay!)'
	if [ $? != 0 ] ; then {
		echo "Drive Failure Detected/Predicted: $1"
		$smartctl -c /dev/$1
		$smartctl -v /dev/$1
		$smartctl -L /dev/$1
		exit 1
	} ; fi
sleep 7200
