2006-07-23 02:46:53 +00:00
|
|
|
#!/usr/local/plan9/bin/rc
|
|
|
|
|
|
|
|
if(! ~ $#* 2){
|
|
|
|
echo 'usage: mount addr mtpt' >[1=2]
|
|
|
|
exit usage
|
|
|
|
}
|
|
|
|
switch(`{uname}){
|
|
|
|
case Linux
|
2008-06-19 14:51:12 +00:00
|
|
|
if(9 grep -si ' 9p(2000)?$' /proc/filesystems){
|
2007-10-09 23:22:43 +00:00
|
|
|
if(u test -S $1)
|
2012-08-05 17:17:18 +00:00
|
|
|
exec u mount -t 9p -o trans'='unix,uname'='$USER $1 $2
|
|
|
|
exec u mount -t 9p -o trans'='tcp,uname'='$USER $1 $2
|
2006-07-23 02:46:53 +00:00
|
|
|
}
|
2008-06-19 14:51:12 +00:00
|
|
|
if(9 grep -si ' fuse$' /proc/filesystems)
|
2006-07-23 02:46:53 +00:00
|
|
|
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]
|
2007-01-18 12:52:54 +00:00
|
|
|
case Darwin
|
2018-01-31 13:43:49 +00:00
|
|
|
version=`{sw_vers -productVersion|cut -d. -f1,2}
|
2012-10-20 17:28:29 +00:00
|
|
|
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' ||
|
2008-06-19 15:42:16 +00:00
|
|
|
test -d /System/Library/Extensions/fusefs.kext ||
|
2018-01-31 13:43:49 +00:00
|
|
|
test -d /Library/Filesystems/osxfuse.fs/Contents/Extensions/$version/osxfuse.kext ||
|
2012-10-20 17:28:29 +00:00
|
|
|
test -d /Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext ||
|
2018-03-15 01:17:10 +00:00
|
|
|
test -d /opt/local/Library/Filesystems/osxfuse.fs ||
|
2008-06-19 15:42:16 +00:00
|
|
|
test -d /Library/Filesystems/fusefs.fs/Support/fusefs.kext)
|
2007-01-18 12:52:54 +00:00
|
|
|
exec 9pfuse $1 $2
|
|
|
|
echo 'don''t know how to mount (no fuse)' >[1=2]
|
2006-07-23 02:46:53 +00:00
|
|
|
case *
|
|
|
|
echo 'can''t mount on' `{uname} >[1=2]
|
|
|
|
}
|
|
|
|
exit nomount
|