From 91bb2e91bd8323fd616c6a5c503fe430bc61ef73 Mon Sep 17 00:00:00 2001 From: наб Date: Sat, 22 May 2021 01:45:40 +0200 Subject: Turn checkbashisms into a make target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit make_gitrev.sh actually breaks checkbashisms' parser, which /insists/ that the end-of-line " is actually a string start Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia Ziemiańska Closes #12101 --- cmd/zpool/zpool.d/smart | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cmd') diff --git a/cmd/zpool/zpool.d/smart b/cmd/zpool/zpool.d/smart index b71591abb..b95256d75 100755 --- a/cmd/zpool/zpool.d/smart +++ b/cmd/zpool/zpool.d/smart @@ -62,17 +62,14 @@ get_filename_from_dir() done } -script=$(basename "$0") +script="${0##*/}" if [ "$1" = "-h" ] ; then echo "$helpstr" | grep "$script:" | tr -s '\t' | cut -f 2- exit fi -smartctl_path=$(command -v smartctl) - -# shellcheck disable=SC2015 -if [ -b "$VDEV_UPATH" ] && [ -x "$smartctl_path" ] || [ -n "$samples" ] ; then +if [ -b "$VDEV_UPATH" ] && PATH="/usr/sbin:$PATH" command -v smartctl > /dev/null || [ -n "$samples" ] ; then if [ -n "$samples" ] ; then # cat a smartctl output text file instead of running smartctl # on a vdev (only used for developer testing). @@ -80,7 +77,7 @@ if [ -b "$VDEV_UPATH" ] && [ -x "$smartctl_path" ] || [ -n "$samples" ] ; then echo "file=$file" raw_out=$(cat "$samples/$file") else - raw_out=$(eval "sudo $smartctl_path -a $VDEV_UPATH") + raw_out=$(sudo smartctl -a "$VDEV_UPATH") fi # What kind of drive are we? Look for the right line in smartctl: -- cgit v1.2.3