From 84277a19e7af01f3867278e75d71b37a12c3d8cf Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Fri, 14 Feb 2020 04:03:33 +0000 Subject: [PATCH] minor improvements --- scripts/system/report_disk_type.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/system/report_disk_type.sh b/scripts/system/report_disk_type.sh index 8236788b..7bfa0b4d 100644 --- a/scripts/system/report_disk_type.sh +++ b/scripts/system/report_disk_type.sh @@ -1,7 +1,7 @@ #!/bin/bash -# reports whether the disk partition provided is spinning physical media or solid state. -# if no partition is specified, then /dev/sda is the default. +# reports whether a disk is spinning physical media or solid state. +# if no drive is specified, then /dev/sda is the default. source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" @@ -10,7 +10,9 @@ drive="$1"; shift # plug in a default drive if none is provided. if [ -z "$drive" ]; then drive="sda"; fi -# chop off the /dev/ portion of the disk partition name, if it exists. +# chop off the /dev/ portion of the disk name, if it exists. also chop off +# any partition numbers, since the script can only check whole drives (where, +# so far at least, all partitions on a drive are the same type). if [[ "$drive" =~ ^/dev/.*$ ]]; then drive="$(echo "$drive" | sed -e 's/^\/dev\///')" # echo "after mangle, drive is: '$drive'" @@ -32,3 +34,4 @@ else echo "drive $drive is a spinning physical disk." fi + -- 2.34.1