Updated hardware_output to work correctly with nvme drives
Kyle Sheumaker [Fri, 6 Oct 2017 20:25:50 +0000 (15:25 -0500)]
etc/hardware_output.sh

index 67e0b2e..0fb1d60 100755 (executable)
@@ -41,7 +41,7 @@ disk_list() {
                fi
        done
 
-       for i in `ls -1 /dev/nvme* | grep "/dev/nvme[0-9]+n[0-9]+$/"`
+       for i in `ls -1 /dev/nvme* | grep "/dev/nvme[0-9]*n[0-9]*$"`
        do
                dev=`basename $i`
                exists=`cat /proc/partitions | awk '{print  $4}' | grep $dev`
@@ -68,7 +68,7 @@ disk_list() {
 nvme_serialno() {
        dev=$1
 
-       sn=`nvme id-ctrl /dev/${dev} | grep sn | cut -d":" -f1`
+       sn=`nvme id-ctrl /dev/${dev} | grep sn | cut -d":" -f2`
        echo $sn
 }