scan-hdd script useable
This commit is contained in:
parent
80ca8d96fc
commit
63109fc217
1 changed files with 20 additions and 0 deletions
20
scripts/scan-hdd
Executable file
20
scripts/scan-hdd
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z $OUTPUT_DIR ] ; then
|
||||
source scan-dmidecode
|
||||
fi
|
||||
|
||||
DISKS=`smartctl --scan | cut -d ' ' -f 1` # | sed 's/^.*\/// ; s/$//'`
|
||||
#echo $DISKS
|
||||
#exit
|
||||
#DISKS=sda
|
||||
for DISK in ${DISKS}
|
||||
do
|
||||
#echo $DISK #-n "$DISK:" #>> $OUTPUT_DIR/disk.lst
|
||||
echo -n "$DISK:" >> $OUTPUT_DIR/disk.lst
|
||||
smartctl -i $DISK \
|
||||
| grep -i 'serial number' \
|
||||
| cut -d ':' -f 2 \
|
||||
| sed 's/\s\+//' \
|
||||
>> $OUTPUT_DIR/disk.lst
|
||||
done
|
Loading…
Reference in a new issue