-
Notifications
You must be signed in to change notification settings - Fork 274
Description
Lines 17 to 22 in a951b9a
| for opts in $(fstabinfo -o -t nfs,nfs4); do | |
| case $opts in | |
| noauto) ;; | |
| *) mywant="$mywant nfsclient"; break ;; | |
| esac | |
| done |
If I understand correctly, this portion of code is supposed to check, amongst the nfs mounts, whether at least one doesn't have the noauto option, and if so, to add nfsclient as a dependency.
Each looped-over variable $opts is the output of fstabinfo -o -t nfs,nfs4 which is one line (per NFS mount) with all the options, comma separated. It seems to me there is an issue in the case check: noauto) will only match if one of the $opts (a comma-separated line) is equal to noauto, but that option may be used amongst others, in which occurrence the case noauto) will not match.
The fix is to change the case to *noauto*), which will match if the option noauto is present in the line at all.
Example of fstabinfo output.
$ /usr/libexec/rc/bin/fstabinfo -o -t nfs
noauto,soft,uid=1000,gid=1000
Example of the behavior.
$ case $(/usr/libexec/rc/bin/fstabinfo -o -t nfs) in noauto) echo 'noauto';; *noauto*) echo '*noauto*';; *) echo '*';; esac
*noauto*