Skip to content

Instantly share code, notes, and snippets.

@truekonrads
Created February 23, 2017 16:15
Show Gist options
  • Select an option

  • Save truekonrads/61103901f740d8ade004fedc161a1cc7 to your computer and use it in GitHub Desktop.

Select an option

Save truekonrads/61103901f740d8ade004fedc161a1cc7 to your computer and use it in GitHub Desktop.
#!/bin/sh
showmount -e $1|perl -wne 'chomp; $root=$1 if m!Export list for ([^:]+):!; if (defined($root) and m!^(/.+?)\s+(\*|\([^)]+\))$!){ $dir="/mnt/nfs/$root/$1"; print "mkdir -p \"$dir\"\n";print "mount -o vers=3,nolock \"$root:$1\" \"$dir\"\n";}'|sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment