From: Fred T. Hamster Date: Fri, 14 Feb 2020 04:03:33 +0000 (+0000) Subject: minor improvements X-Git-Tag: 2.140.117^2~16 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=7f05aaeddee6febd022c4bcc6ec41af99c39e0c4 minor improvements --- 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 +