Enable shellcheck to run for select scripts

Enable shellcheck to run on zed scripts,
paxcheck.sh, zfs-tests.sh, zfs.sh, and zloop.sh.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5812
This commit is contained in:
Giuseppe Di Natale
2017-03-09 10:20:15 -08:00
committed by Brian Behlendorf
parent 9b77d1c958
commit c552fbc5f0
9 changed files with 114 additions and 100 deletions
+7 -4
View File
@@ -1,3 +1,5 @@
#!/bin/sh
# shellcheck disable=SC2039
# zed-functions.sh
#
# ZED helper functions for use in ZEDLETs
@@ -126,6 +128,7 @@ zed_lock()
#
eval "exec ${fd}> '${lockfile}'"
err="$(flock --exclusive "${fd}" 2>&1)"
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
zed_log_err "failed to lock \"${lockfile}\": ${err}"
fi
@@ -162,8 +165,8 @@ zed_unlock()
fi
# Release the lock and close the file descriptor.
#
err="$(flock --unlock "${fd}" 2>&1)"
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
zed_log_err "failed to unlock \"${lockfile}\": ${err}"
fi
@@ -424,14 +427,14 @@ zed_rate_limit()
# Return
# Pool name
#
function zed_guid_to_pool
zed_guid_to_pool()
{
if [ -z "$1" ] ; then
return
fi
guid=$(printf "%llu" $1)
guid=$(printf "%llu" "$1")
if [ ! -z "$guid" ] ; then
$ZPOOL get -H -ovalue,name guid | awk '$1=='$guid' {print $2}'
$ZPOOL get -H -ovalue,name guid | awk '$1=='"$guid"' {print $2}'
fi
}