#!/bin/sh # check if a kernel module is loaded [ "$1" == "" ] && echo "Usage: $0 MODULE [q]" && exit 0 #if lsmod | grep -Eq "$1" &> /dev/null ; then if grep -Eq "$1" /proc/modules &> /dev/null ; then [ "$2" == "q" ] || echo "$1 is loaded!" exit 0 else [ "$2" == "q" ] || echo "$1 is not loaded!" exit 1 fi