]> git.lizzy.rs Git - plan9front.git/blobdiff - rc/bin/nusbrc
merge
[plan9front.git] / rc / bin / nusbrc
index 85f9e768d77f5ae5095e829c4e39df0fe297cf39..71fe5734e91eebaf1cfb951cd385f767af6cc3fd 100644 (file)
@@ -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,8 +28,13 @@ if(! bind -a '#u' /dev)
                }
        }
        fn detach {
+               switch($4){
+               case *02
+                       rm -f '#σ/usbnet/'^$1.*
+               }
        }
        rc < '#σ/usb/usbevent' &
 }
 
 bind -a '#σ/usb' /dev
+bind -a '#σ/usbnet' /net