diff --git a/linux/t_rmmod_modprobe_loop.sh b/linux/t_rmmod_modprobe_loop.sh new file mode 100755 index 0000000..7999cce --- /dev/null +++ b/linux/t_rmmod_modprobe_loop.sh @@ -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 +