diff options
author | Brian Behlendorf <[email protected]> | 2018-01-17 10:17:16 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-17 10:17:16 -0800 |
commit | 3da3488e6339ff2dc5c7f3da8c8a0c552d018d68 (patch) | |
tree | acf9843a79221a7fa9de852507d3cdef8772ee44 /scripts/zfs.sh | |
parent | d658b2caa95726c13d99123874910cdedc7ce866 (diff) |
Fix shellcheck v0.4.6 warnings
Resolve new warnings reported after upgrading to shellcheck
version 0.4.6. This patch contains no functional changes.
* egrep is non-standard and deprecated. Use grep -E instead. [SC2196]
* Check exit code directly with e.g. 'if mycmd;', not indirectly
with $?. [SC2181] Suppressed.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #7040
Diffstat (limited to 'scripts/zfs.sh')
-rwxr-xr-x | scripts/zfs.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/zfs.sh b/scripts/zfs.sh index 8ece6ef5f..3cfb0c1f1 100755 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -79,7 +79,7 @@ check_modules() { $KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ICP $KMOD_ZFS; do NAME=$(basename "$KMOD" .ko) - if lsmod | egrep -q "^${NAME}"; then + if lsmod | grep -E -q "^${NAME}"; then LOADED_MODULES="$LOADED_MODULES\t$NAME\n" fi @@ -114,6 +114,7 @@ load_module() { fi $LDMOD "$KMOD" >/dev/null 2>&1 + # shellcheck disable=SC2181 if [ $? -ne 0 ]; then echo "Failed to load $KMOD" return 1 @@ -165,7 +166,7 @@ unload_modules() { for KMOD in $KMOD_ZFS $KMOD_ICP $KMOD_ZCOMMON $KMOD_ZUNICODE \ $KMOD_ZNVPAIR $KMOD_ZAVL $KMOD_SPLAT $KMOD_SPL; do NAME=$(basename "$KMOD" .ko) - USE_COUNT=$(lsmod | egrep "^${NAME} " | awk '{print $3}') + USE_COUNT=$(lsmod | grep -E "^${NAME} " | awk '{print $3}') if [ "$USE_COUNT" = "0" ] ; then unload_module "$KMOD" || return 1 |