Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison sbin/fjail @ 197:3181a6b5758e
FIX: Using a pipeline within a function correctly with regard to return values:
The last pipeline element determines the status. Account for this.
So instead of a here-doc a pipeline can be used.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 21 Aug 2022 10:49:00 +0200 |
| parents | a4fd3bcbbf1c |
| children | dd8a9bbdf8c0 |
comparison
equal
deleted
inserted
replaced
| 196:a4fd3bcbbf1c | 197:3181a6b5758e |
|---|---|
| 89 local _mountpoint | 89 local _mountpoint |
| 90 local _ds _mount _rest | 90 local _ds _mount _rest |
| 91 | 91 |
| 92 _mountpoint="$1" | 92 _mountpoint="$1" |
| 93 | 93 |
| 94 while IFS=' '$'\t' read -r _ds _mount _rest ; do | 94 mount -t zfs -p \ |
| 95 if [ "$_mount" = "$_mountpoint" ]; then | 95 | { |
| 96 echo "${_ds}" | 96 while IFS=' '$'\t' read -r _ds _mount _rest ; do |
| 97 return 0 | 97 if [ "$_mount" = "$_mountpoint" ]; then |
| 98 fi | 98 echo "${_ds}" |
| 99 done <<EOF__GDSFM | 99 return 0 |
| 100 $(mount -t zfs -p) | 100 fi |
| 101 EOF__GDSFM | 101 done |
| 102 return 1 | 102 return 1 |
| 103 } | |
| 103 } | 104 } |
| 104 | 105 |
| 105 | 106 |
| 106 _get_dataset_for_varempty() { | 107 _get_dataset_for_varempty() { |
| 107 : 'Allow special handling for <mountpoint>/var/empty which may be | 108 : 'Allow special handling for <mountpoint>/var/empty which may be |
