aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-22 01:45:40 +0200
committerBrian Behlendorf <[email protected]>2021-06-09 13:05:34 -0700
commit91bb2e91bd8323fd616c6a5c503fe430bc61ef73 (patch)
tree9a37dc3d3aa0926ebf6935bea1a0ec42fcc0f4aa /cmd
parent132240507d0ab2999e764537b181e89ecc3c2b0e (diff)
Turn checkbashisms into a make target
make_gitrev.sh actually breaks checkbashisms' parser, which /insists/ that the end-of-line " is actually a string start Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12101
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/zpool/zpool.d/smart9
1 files changed, 3 insertions, 6 deletions
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: