Jens-Uwe Mager schrieb am Fri, Dec 29, 2000 at 05:35:10PM +0100:
> On Fri, Dec 29, 2000 at 01:47:34PM +0100, Heiko Ronsdorf wrote:
> > Jens-Uwe Mager schrieb am Fri, Dec 29, 2000 at 02:09:14AM +0100:
> > >
> > > > Interesting would also be an automatic "unloading" of the module if
> > > > idle (no discovered devices for "n" seconds)
> > >
> > > No idea with that one, though.
> >
> > Why you don't just add:
> >
> > TIME * * * * rmmod -a || TIME * * * * rmmod irda
> >
> > to your crontab? You don't use the module, so kick it. (this is not unloading
> > if there are no devices)
>
> This does not work as the reference count on irda0 is still one. In my
> case I have to kill the running irattach to be able to unload the irda
> stack.
yepp, as long as irda0 stays up the reference count is >0. So try this one:
#!/bin/bash
if grep nickname /proc/net/irda/discovery; then
exit 0;
fi
ps -ef|grep irattach|awk 'print $1'|xargs kill -TERM
/* sleep 1 */
rmmod -a
exit 0
I don't know if "nickname" is the best choice... :-)
H. Ronsdorf
--
Microsoft is not the answer. Microsoft is the question. The answer is NO.
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www.pasta.cs.UiT.No/mailman/listinfo/linux-irda