pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client.bash - simple Cygwin frontent for the msnfsv41 NFSv4.1 filesystem driver
Posted by Anonymous on Fri 18th Aug 2023 04:05
raw | new post
view followups (newest first): msnfs41client.bash - simple Cygwin frontent for the msnfsv41 NFSv4.1 filesystem driver by Anonymous

  1. #!/bin/bash
  2.  
  3. #
  4. # msnfs41client.bash - simple Cygwin frontent for the msnfsv41
  5. # NFSv4.1 filesystem driver
  6. #
  7.  
  8. #
  9. # Written by Roland Mainz <roland.mainz@nrubsig.org>
  10. #
  11.  
  12. function nfsclient_install
  13. {
  14.         set -o nounset
  15.         set -o xtrace
  16.         set -o errexit
  17.        
  18.         # make sure all binaries are executable, Windows cmd does
  19.         # not care, but Cygwin&bash do.
  20.         # If *.ddl are not executable nfs*.exe fail with 0xc0000022
  21.         chmod a+x *.exe *.dll
  22.  
  23.         if false ; then
  24.                 # install.bat needs PATH to include $PWD
  25.                 PATH="$PWD:$PATH" cmd /c install.bat
  26.         else
  27.                 nfs_install
  28.                 rundll32 setupapi.dll,InstallHinfSection DefaultInstall 132 ./nfs41rdr.inf
  29.         fi
  30.  
  31.         cp etc_netconfig /cygdrive/c/etc/netconfig
  32.         cp ms-nfs41-idmap.conf /cygdrive/c/etc/.
  33.  
  34.         bcdedit /set testsigning on
  35.         regtool -s set '/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Domain' 'GLOBAL.LOC'
  36.  
  37.         sc query Dfsc
  38.         sc stop Dfsc || true
  39.         sc config Dfsc start=disabled
  40.  
  41.         sc query nfs41_driver
  42.         domainname
  43.  
  44.         return 0
  45. }
  46.  
  47. function nfsclient_rundeamon
  48. {
  49.         set -o xtrace
  50.         set -o nounset
  51.         set -o errexit
  52.        
  53.         nfsd_debug -d 0 --noldap --gid 1000 --uid 1000
  54.         return $?
  55. }
  56.  
  57. function nfsclient_mount_homedir
  58. {
  59.         set -o xtrace
  60.         set -o nounset
  61.        
  62.         nfs_mount -p -o sec=sys H '192.168.2.150:/home/test001'
  63.         return $?
  64. }
  65.  
  66. function main
  67. {
  68.         typeset cmd="$1"
  69.        
  70.         export PATH="$PWD:$PATH"
  71.        
  72.         if [[ ! -x 'nfsd.exe' ]] ; then
  73.                 printf $"%s: nfsd not found in %q\n" "$0" "$PWD" 1>&2
  74.                 return 1
  75.         fi
  76.         if [[ ! -x 'nfs_mount.exe' ]] ; then
  77.                 printf $"%s: nfs_mount not found in %q\n" "$0" "$PWD" 1>&2
  78.                 return 1
  79.         fi
  80.        
  81.         case "$cmd" in
  82.                 'install')
  83.                         nfsclient_install
  84.                         return $?
  85.                         ;;
  86.                 'run_deamon')
  87.                         nfsclient_rundeamon
  88.                         return $?
  89.                         ;;
  90.                 'mount_homedir')
  91.                         nfsclient_mount_homedir
  92.                         ;;
  93.                 *)
  94.                         printf $"%s: Unknown cmd %q\n" "$0" "$cmd" 1>&2
  95.                         return 1
  96.                         ;;
  97.         esac
  98.         return 1
  99. }
  100.  
  101. main "$@"
  102. exit $?
  103.  
  104. # EOF.

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at