summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@rei2>2012-01-09 21:44:27 +0100
committercinap_lenrek <cinap_lenrek@rei2>2012-01-09 21:44:27 +0100
commitb1fd0dd118945a2acebe05805964b506d4ab44e3 (patch)
treee6be695889e288f44579997bb926474874049272
parent659943558fcb6a04f5e4b1bf11aa2cb4c1a5065c (diff)
downloadplan9front-b1fd0dd118945a2acebe05805964b506d4ab44e3.tar.xz
nusbrc: fix permissions, restore before complication of complication
-rwxr-xr-x[-rw-r--r--]rc/bin/nusbrc9
1 files changed, 8 insertions, 1 deletions
diff --git a/rc/bin/nusbrc b/rc/bin/nusbrc
index a9efcf8a6..71fe5734e 100644..100755
--- a/rc/bin/nusbrc
+++ b/rc/bin/nusbrc
@@ -5,6 +5,8 @@ if(! test -e '#σ/usb/usbevent')
if(! bind -a '#u' /dev)
exit
+mkdir -p -m 700 '#σc/usbnet'
+
@{
rfork ne
fn attach {
@@ -14,6 +16,7 @@ if(! bind -a '#u' /dev)
case *02
# serial and ethernet
nusb/serial $1
+ nusb/ether $1
case *03
# handled /sys/src/9/boot/nusbrc
# nusb/kb $1
@@ -25,9 +28,13 @@ if(! bind -a '#u' /dev)
}
}
fn detach {
- # handled /sys/src/9/boot/nusbrc
+ switch($4){
+ case *02
+ rm -f '#σ/usbnet/'^$1.*
+ }
}
rc < '#σ/usb/usbevent' &
}
bind -a '#σ/usb' /dev
+bind -a '#σ/usbnet' /net