add script to load and unload module

This commit is contained in:
Nico Schottelius 2009-03-12 16:08:50 +01:00
parent ec746f51ab
commit 388077ca79

19
linux/t_rmmod_modprobe_loop.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
# Nico Schottelius
# Script to test if a module can be reloaded
mod="$1"; shift
cmd="$1"; shift
while true; do
loaded=$(lsmod | grep ^${mod})
if [ "$loaded" ]; then
rmmod -v "$mod"
else
modprobe -v "$mod"
fi
$cmd
done