Re: Simple Shell Script



On 02/27/2007 05:39 AM, Dan N wrote:
I need a script to insmod a module if lsmod doesn't list it. How would I
go about doing that? I know it would be pretty simple.

Thanks

Dan
lsmod | grep <yourmod>

it's return value is true, if something comes out, and not, if it isn't

maybe somthing like:


if $(lsmod | grep <yourmod>); then
exit 0
fi

insmod <yourmod>


however, you might want to use modprobe instead of insmod.

--polemon

--
-EOF-
.



Relevant Pages

  • Re: multisystem joystick: built adapter, now what?
    ... >> Never use insmod when you can use modprobe. ... I'd hold off on the 2.6 kernel ... > Throwing an 'insmod joydev' into the loop gets jstest running, ...
    (comp.os.linux.misc)
  • SB16 -- no such device
    ... I've got an ISA PnP Sound Blaster 16 in Mandrake 9.1. ... Insmod errors can be caused by incorrect module parameters, ... modprobe: ... modprobe: insmod snd-sb16 failed ...
    (comp.os.linux.hardware)
  • Re: [SOLVED] Netfilter Modules
    ... Alexander Dalloz wrote: ... > modprobe and not insmod. ... > kernel I just called ...
    (Fedora)
  • Re: How to use module in 2.6
    ... > | kernel becouse it have old format)) ... > insmod module.ko, not insmod module.o ... > Or use modprobe module ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • cs4281: suddenly not working anymore
    ... The sound works great until today suddenly it stops working. ... I run modprobe cs4281, ... insmod errors can be caused by incorrect module parameters, ...
    (Fedora)