Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
diff sbin/fzfs @ 527:b7d60802b25f
Use absolute paths for "mount" (all occurrences) and grep (some)
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 04 Sep 2024 18:29:42 +0200 |
| parents | c05ef1c86c9c |
| children | 93b98803219b |
line wrap: on
line diff
--- a/sbin/fzfs Wed Sep 04 11:15:29 2024 +0200 +++ b/sbin/fzfs Wed Sep 04 18:29:42 2024 +0200 @@ -209,7 +209,7 @@ mkdir -p "${_real_mp}" 1> /dev/null 2> /dev/null || \ { echo "ERROR: cannot create mountpoint ${_real_mp}" >&2; _umount_datasets _mounted_datasets || true; return 1; } echo "Mounting ${_name} on ${_real_mp}" - if mount -t zfs "${_name}" "${_real_mp}"; then + if /sbin/mount -t zfs "${_name}" "${_real_mp}"; then array_append _mounted_datasets "${_name}" else if ! checkyes _opt_keep; then @@ -291,13 +291,13 @@ # Just determine whether the given dataset name exists _rootds_mountpoint="$(zfs list -H -o mountpoint -t filesystem "${_dsname}")" || { echo "ERROR: dataset not found" 1>&2; return 1; } - mount -t zfs -p \ - | grep -E "^${_dsname}(/|\s)" \ - | sort -n -r \ + /sbin/mount -t zfs -p \ + | LC_ALL=C GREP_OPTIONS="" /usr/bin/egrep "^${_dsname}(/|\s)" \ + | /usr/bin/sort -n -r \ | { while IFS=' '$'\t' read -r _name _mp _rest ; do echo "Umounting ${_name} on ${_mp}" - umount "${_mp}" || return 1 + /sbin/umount "${_mp}" || return 1 done } return 0
