zfs initcpio hook: fix incorrect shell redirection

In order to fulfill the intended purpose, one must redirect to /dev/null
before redirecting stderr. Otherwise stderr just goes to the console on
stdout...
This commit is contained in:
Eli Schwartz
2020-10-09 13:04:08 -04:00
parent bc6da8e5b9
commit 4d76893b86
3 changed files with 5 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ zfs_mount_handler () {
local pool="${ZFS_DATASET%%/*}"
local rwopt_exp="${rwopt:-ro}"
if ! zpool list -H "${pool}" 2>&1 > /dev/null ; then
if ! zpool list -H "${pool}" >/dev/null 2>&1; then
if [ ! "${rwopt_exp}" = "rw" ]; then
msg "ZFS: Importing pool ${pool} readonly."
ZPOOL_IMPORT_FLAGS="${ZPOOL_IMPORT_FLAGS} -o readonly=on"