On 04/09/14 at 11:49am, Vivek Goyal wrote:
On Wed, Apr 09, 2014 at 01:25:04PM +0800, Baoquan He wrote:
[..]
+get_fs_type_from_target() +{
- local fstype
- fstype=$(findmnt -k -f -n -r -o FSTYPE $1)
- [[ $fstype = *nfs* ]] && fstype="nfs"
- echo $fstype
I think instead of resetting it here, take care of it in caller. Let this function return actual fstype.
Also *nfs* seems to be too generic. Now foonfsbar fs type will also match this search.
Why not check for exact version numbers and if need be provide an helper function.
is_fs_type_nfs() { if fstype==nfs or fstype==nfs4 reutrn 0 return 1 }
Will change per your idea. Thanks, Vivek.
Thanks Vivek