diff options
author | наб <[email protected]> | 2021-05-21 23:43:38 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-06-09 13:05:34 -0700 |
commit | 132240507d0ab2999e764537b181e89ecc3c2b0e (patch) | |
tree | 3450e3a8132bbdc611944445146f259e541a0261 /etc/init.d/zfs-import.in | |
parent | d6f8f41c21b42a1b5a36850c0f7b18be9a05ecd9 (diff) |
Turn shellcheck into a normal make target. Fix new files it caught
This checks every file it checked (and a few more),
but explicitly instead of "if it works it works" best-effort
(which wasn't that good anyway)
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #10512
Closes #12101
Diffstat (limited to 'etc/init.d/zfs-import.in')
-rwxr-xr-x | etc/init.d/zfs-import.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/init.d/zfs-import.in b/etc/init.d/zfs-import.in index 6b1b2f243..e4bc7b833 100755 --- a/etc/init.d/zfs-import.in +++ b/etc/init.d/zfs-import.in @@ -72,6 +72,7 @@ do_import_all_visible() local exception dir ZPOOL_IMPORT_PATH RET=0 r=1 # In case not shutdown cleanly. + # shellcheck disable=SC2154 [ -n "$init" ] && rm -f /etc/dfs/sharetab # Just simplify code later on. @@ -157,7 +158,7 @@ do_import_all_visible() echo "$dir" | grep -q /by-vdev && continue [ ! -d "$dir" ] && continue - echo -n "$dir:" + printf "%s" "$dir:" done | sed 's,:$,,g')" if [ -d "/dev/disk/by-vdev" ] @@ -214,6 +215,7 @@ do_import_all_visible() # Import by using ZPOOL_IMPORT_PATH (either set above or in # the config file) _or_ with the 'built in' default search # paths. This is the preferred way. + # shellcheck disable=SC2086 "$ZPOOL" import -N ${ZPOOL_IMPORT_OPTS} "$pool" 2> /dev/null r="$?" ; RET=$((RET + r)) if [ "$r" -eq 0 ] @@ -235,6 +237,7 @@ do_import_all_visible() zfs_log_progress_msg " using cache file" fi + # shellcheck disable=SC2086 "$ZPOOL" import -c "$ZPOOL_CACHE" -N ${ZPOOL_IMPORT_OPTS} \ "$pool" 2> /dev/null r="$?" ; RET=$((RET + r)) |