comparison sbin/fjail @ 200:8f739dd15d7f

FIX: Use "||" instead of "|" when handling an error case
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 21 Aug 2022 11:19:47 +0200
parents a8b6584d24ec
children 687210f46b8f
comparison
equal deleted inserted replaced
199:a8b6584d24ec 200:8f739dd15d7f
449 _dsname="${1-}" 449 _dsname="${1-}"
450 [ -z "${_dsname}" ] && \ 450 [ -z "${_dsname}" ] && \
451 { echo "ERROR: no dataset given" >&2; return 2; } 451 { echo "ERROR: no dataset given" >&2; return 2; }
452 452
453 # Just determine whether the given dataset name exists 453 # Just determine whether the given dataset name exists
454 _rootds_mountpoint="$(zfs list -H -o mountpoint -t filesystem "${_dsname}")" | return 1 454 _rootds_mountpoint="$(zfs list -H -o mountpoint -t filesystem "${_dsname}")" || { echo "ERROR: dataset not found" >&2; return 1; }
455 455
456 mount -t zfs -p | \ 456 mount -t zfs -p | \
457 grep -E "^${_dsname}(/|\s)" | \ 457 grep -E "^${_dsname}(/|\s)" | \
458 sort -n -r | \ 458 sort -n -r | \
459 while IFS=' '$'\t' read -r _name _mp _rest ; do 459 while IFS=' '$'\t' read -r _name _mp _rest ; do