pastebin - collaborative debugging tool
rovema.kpaste.net RSS

Difference between
modified post 53b0fec75 by Anonymous on Mon 28th Aug 2023 00:35
original post 34af6 by Anonymous on Fri 18th Aug 2023 04:05
Download diff
Show old version | new version | both versions

    
11
#!/bin/bash
22
33
#
44
# msnfs41client.bash - simple Cygwin frontent for the msnfsv41
55
# NFSv4.1 filesystem driver
66
#
77
88
#
99
# Written by Roland Mainz <roland.mainz@nrubsig.org>
1010
#
1111
1212
function nfsclient_install
1313
{
1414
	set -o nounset
1515
	set -o xtrace
1616
	set -o errexit
1717
18+
	#
1827
	# make sure all binaries are executable, Windows cmd does
1928
	# not care, but Cygwin&bash do.
2029
	# If *.ddl are not executable nfs*.exe fail with 0xc0000022
2130
	chmod a+x *.exe *.dll
2231
2332
	if false ; then
2433
		# install.bat needs PATH to include $PWD
2534
		PATH="$PWD:$PATH" cmd /c install.bat
2635
	else
2736
		nfs_install
2837
		rundll32 setupapi.dll,InstallHinfSection DefaultInstall 132 ./nfs41rdr.inf
2938
	fi
3039
3140
	cp etc_netconfig /cygdrive/c/etc/netconfig
3241
	cp ms-nfs41-idmap.conf /cygdrive/c/etc/.
3342
3443
	bcdedit /set testsigning on
3544
	regtool -s set '/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Domain' 'GLOBAL.LOC'
3645
3746
	sc query Dfsc
3847
	sc stop Dfsc || true
3948
	sc config Dfsc start=disabled
4049
4150
	sc query nfs41_driver
4251
	domainname
4352
4453
	return 0
4554
}
4655
4756
function nfsclient_rundeamon
4857
{
4958
	set -o xtrace
5059
	set -o nounset
5160
	set -o errexit
5261
5362
	nfsd_debug -d 0 --noldap --gid 1000 --uid 1000
5463
	return $?
5564
}
5665
5766
function nfsclient_mount_homedir
5867
{
5968
	set -o xtrace
6069
	set -o nounset
6170
6271
	nfs_mount -p -o sec=sys H '192.168.2.150:/home/test001'
6372
	return $?
6473
}
6574
75+
function nfsclient_umount_homedir
6776
{
77+
	set -o xtrace
6979
80+
	nfs_mount -d H
7183
72-
	if [[ ! -x 'nfsd.exe' ]] ; then
84+
function main
85+
{
7391
		printf $"%s: nfsd not found in %q\n" "$0" "$PWD" 1>&2
7492
		return 1
7593
	fi
76-
	if [[ ! -x 'nfs_mount.exe' ]] ; then
94+
	if ! which 'nfs_mount.exe' >/dev/null 2>&1 ; then
7795
		printf $"%s: nfs_mount not found in %q\n" "$0" "$PWD" 1>&2
7896
		return 1
7997
	fi
8098
8199
	case "$cmd" in
82100
		'install')
83101
			nfsclient_install
84102
			return $?
85103
			;;
86104
		'run_deamon')
87105
			nfsclient_rundeamon
88106
			return $?
89107
			;;
90108
		'mount_homedir')
91109
			nfsclient_mount_homedir
110+
			return $?
92111
			;;
112+
		'umount_homedir')
93116
		*)
94117
			printf $"%s: Unknown cmd %q\n" "$0" "$cmd" 1>&2
95118
			return 1
96119
			;;
97120
	esac
98121
	return 1
99122
}
100123
101124
main "$@"
102125
exit $?
103126
104127
# EOF.
105128

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