plan9port / bin / mount

#!/usr/local/plan9/bin/rc

if(! ~ $#* 2){
	echo 'usage: mount addr mtpt' >[1=2]
	exit usage
}
switch(`{uname}){
case Linux
	if(9 grep -si '	9p(2000)?$' /proc/filesystems){
		if(u test -S $1)
			exec u mount -t 9p -o trans'='unix,uname'='$USER $1 $2
		exec u mount -t 9p -o trans'='tcp,uname'='$USER $1 $2
	}
	if(9 grep -si '	fuse$' /proc/filesystems)
		exec 9pfuse $1 $2
	echo 'don''t know how to mount (no 9p, no fuse)' >[1=2]
case FreeBSD
	if(kldstat|9 grep -si ' fuse')
		exec 9pfuse $1 $2
	echo 'don''t know how to mount (no fuse)' >[1=2]
case Darwin
	if(sysctl fuse.version >[2]/dev/null |9 grep -si 'fuse.version' ||
	   sysctl macfuse.version.number >[2]/dev/null |9 grep -si 'fuse.version' ||
	   sysctl osxfuse.version.number >[2]/dev/null |9 grep -si 'fuse.version' ||
	   test -d /System/Library/Extensions/fusefs.kext ||
	   test -d /Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext ||
	   test -d /Library/Filesystems/fusefs.fs/Support/fusefs.kext)
		exec 9pfuse $1 $2
	echo 'don''t know how to mount (no fuse)' >[1=2]
case *
	echo 'can''t mount on' `{uname} >[1=2]
}
exit nomount
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.