#Habilta el soporte a smartctl y envía a realizar el test largo
P="$PATH"
PATH=""
for DISCO in $(/sbin/fdisk -l|/bin/grep " /dev"|/bin/awk '{print $2}'|/bin/sed "s/://g")
do
CNT=$(/usr/sbin/smartctl -i $DISCO|/bin/grep "SMART support is: Available"|/usr/bin/wc -l)
if [ $CNT -eq 1 ];
then
CNT=$(/usr/sbin/smartctl -i $DISCO|/bin/grep "SMART support is: Disabled"|/usr/bin/wc -l)
if [ $CNT -eq 1 ];
then
/usr/sbin/smartctl -s on $DISCO
fi
/usr/sbin/smartctl -t long $DISCO
fi
done
PATH="$P"
echo "<html><head></head><body style=\"font-family:'Courier New';font-size:10px;\"><pre>" > /tmp/smartd.log
P="$PATH"
PATH="/bin"
for DEV in $(/sbin/fdisk -l|/bin/grep " /dev"|/bin/awk '{print $2}'|/bin/sed "s/://g")
do
echo "<br /><hr /><br />" >> /tmp/smartd.log
/usr/sbin/smartctl -i -l selftest -HAc $DEV >> /tmp/smartd.log
echo "<br /><hr /><br />" >> /tmp/smartd.log
done
/bin/cat /tmp/smartd.log|/usr/bin/mutt -e "set content_type=text/html" root
PATH="$P"
|