#!/bin/sh

DEVS=/root/disks
SMART=/tmp/smartctl-current

for DEV in `cat ${DEVS}`; do
	if [ `echo ${DEV} | cut -c 1` == '#' ]; then
		echo Skipping device $DEV
		continue
	fi
	if [ -b "${DEV}1" ]; then
		echo Device $DEV already prepared.
		continue
	fi
	smartctl -a ${DEV} > ${SMART}
	cat ${SMART} | grep 'Model Family'
	SLABEL=`cat ${SMART} | grep 'Serial Number' | rev | cut -c 1-4 | rev`
	echo $DEV: $SLABEL
done
