X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=blobdiff_plain;f=scripts%2Fsystem%2Freport_disk_type.sh;h=7bfa0b4db4554bfbccb689c6e24a32ed564a92b2;hp=8236788b751d14d3935b6cac7417425e2c3f761f;hb=7f05aaeddee6febd022c4bcc6ec41af99c39e0c4;hpb=baa1a03fa9712eb4e6d5a2e0bc73fdc3ec55c631 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 +