- #!/bin/bash
- #
- # msnfs41client.bash - simple Cygwin frontent for the msnfsv41
- # NFSv4.1 filesystem driver
- #
- #
- # Written by Roland Mainz <roland.mainz@nrubsig.org>
- #
- function nfsclient_install
- {
- set -o nounset
- set -o xtrace
- set -o errexit
- # make sure all binaries are executable, Windows cmd does
- # not care, but Cygwin&bash do.
- # If *.ddl are not executable nfs*.exe fail with 0xc0000022
- chmod a+x *.exe *.dll
- if false ; then
- # install.bat needs PATH to include $PWD
- PATH="$PWD:$PATH" cmd /c install.bat
- else
- nfs_install
- rundll32 setupapi.dll,InstallHinfSection DefaultInstall 132 ./nfs41rdr.inf
- fi
- cp etc_netconfig /cygdrive/c/etc/netconfig
- cp ms-nfs41-idmap.conf /cygdrive/c/etc/.
- bcdedit /set testsigning on
- regtool -s set '/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Domain' 'GLOBAL.LOC'
- sc query Dfsc
- sc stop Dfsc || true
- sc config Dfsc start=disabled
- sc query nfs41_driver
- domainname
- return 0
- }
- function nfsclient_rundeamon
- {
- set -o xtrace
- set -o nounset
- set -o errexit
- nfsd_debug -d 0 --noldap --gid 1000 --uid 1000
- return $?
- }
- function nfsclient_mount_homedir
- {
- set -o xtrace
- set -o nounset
- nfs_mount -p -o sec=sys H '192.168.2.150:/home/test001'
- return $?
- }
- function main
- {
- typeset cmd="$1"
- export PATH="$PWD:$PATH"
- if [[ ! -x 'nfsd.exe' ]] ; then
- printf $"%s: nfsd not found in %q\n" "$0" "$PWD" 1>&2
- return 1
- fi
- if [[ ! -x 'nfs_mount.exe' ]] ; then
- printf $"%s: nfs_mount not found in %q\n" "$0" "$PWD" 1>&2
- return 1
- fi
- case "$cmd" in
- 'install')
- nfsclient_install
- return $?
- ;;
- 'run_deamon')
- nfsclient_rundeamon
- return $?
- ;;
- 'mount_homedir')
- nfsclient_mount_homedir
- ;;
- *)
- printf $"%s: Unknown cmd %q\n" "$0" "$cmd" 1>&2
- return 1
- ;;
- esac
- return 1
- }
- main "$@"
- exit $?
- # EOF.
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
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.