aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zpool/zpool.d/smart
diff options
context:
space:
mode:
authorbunder2015 <[email protected]>2019-02-04 12:07:19 -0500
committerBrian Behlendorf <[email protected]>2019-02-04 09:07:19 -0800
commitbf6ca0a6313ad09f4b98f774069693c1b36ecc60 (patch)
tree6adfa8a09605d67cb473d89ce4907b805702081e /cmd/zpool/zpool.d/smart
parentcca14128c956e26486633d50650e11cda89b1d17 (diff)
shellcheck pass
note: which is non-standard. Use builtin 'command -v' instead. [SC2230] note: Use -n instead of ! -z. [SC2236] Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: bunder2015 <[email protected]> Closes #8367
Diffstat (limited to 'cmd/zpool/zpool.d/smart')
-rwxr-xr-xcmd/zpool/zpool.d/smart6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/zpool/zpool.d/smart b/cmd/zpool/zpool.d/smart
index 64b5f6e4e..bd18e9d04 100755
--- a/cmd/zpool/zpool.d/smart
+++ b/cmd/zpool/zpool.d/smart
@@ -69,7 +69,7 @@ if [ "$1" = "-h" ] ; then
exit
fi
-smartctl_path=$(which smartctl)
+smartctl_path=$(command -v smartctl)
if [ -b "$VDEV_UPATH" ] && [ -x "$smartctl_path" ] || [ -n "$samples" ] ; then
if [ -n "$samples" ] ; then
@@ -228,7 +228,7 @@ smart_test)
esac
with_vals=$(echo "$out" | grep -E "$scripts")
-if [ ! -z "$with_vals" ]; then
+if [ -n "$with_vals" ]; then
echo "$with_vals"
without_vals=$(echo "$scripts" | tr "|" "\n" |
grep -v -E "$(echo "$with_vals" |
@@ -237,6 +237,6 @@ else
without_vals=$(echo "$scripts" | tr "|" "\n" | awk '{print $0"="}')
fi
-if [ ! -z "$without_vals" ]; then
+if [ -n "$without_vals" ]; then
echo "$without_vals"
fi