tmount and unmount scripts - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 5801105701ffe5e9695644bfd1a2d79f48977100
(DIR) parent 24c67c31898ff04e62eaa02514cd7c53de5d8f87
(HTM) Author: rsc <devnull@localhost>
Date: Sun, 23 Jul 2006 02:46:53 +0000
mount and unmount scripts
Diffstat:
A bin/mount | 24 ++++++++++++++++++++++++
A bin/unmount | 10 ++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/bin/mount b/bin/mount
t@@ -0,0 +1,24 @@
+#!/usr/local/plan9/bin/rc
+
+if(! ~ $#* 2){
+ echo 'usage: mount addr mtpt' >[1=2]
+ exit usage
+}
+switch(`{uname}){
+case Linux
+ if(lsmod|9 grep -si '^9p(2000)? '){
+ if(test -S $1)
+ exec mount -t 9P -o proto=unix,name=$USER $1 $2
+ exec mount -t 9P -o proto=tcp,name=$USER $1 $2
+ }
+ if(lsmod|9 grep -si '^fuse ')
+ 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 *
+ echo 'can''t mount on' `{uname} >[1=2]
+}
+exit nomount
(DIR) diff --git a/bin/unmount b/bin/unmount
t@@ -0,0 +1,10 @@
+#!/usr/local/plan9/bin/rc
+
+if(! ~ $#* 1){
+ echo 'usage: unmount mtpt' >[1=2]
+ exit usage
+}
+f=`{u mount | grep $1}
+if(echo $f | 9 grep -s 'type fuse')
+ exec fusermount -u -z $1
+exec u umount $1