Streamline module loading

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@663 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2003-07-16 03:22:45 +00:00
parent 0c8365f7bb
commit c89d302114

View File

@ -2689,30 +2689,19 @@ loadmodule() # $1 = module name, $2 - * arguments
{ {
local modulename=$1 local modulename=$1
local modulefile local modulefile
local suffix
if [ -z "`lsmod | grep $modulename`" ]; then if [ -z "`lsmod | grep $modulename`" ]; then
shift shift
modulefile=$MODULESDIR/${modulename}.o
for suffix in o gz ko ; do
modulefile=$MODULESDIR/${modulename}.${suffix}
if [ -f $modulefile ]; then if [ -f $modulefile ]; then
insmod $modulefile $* insmod $modulefile $*
return return
fi fi
# done
# If the modules directory contains compressed modules then we'll
# assume that insmod can load them
#
modulefile=${modulefile}.gz
if [ -f $modulefile ]; then
insmod $modulefile $*
fi
modulefile=${modulefile}.ko
if [ -f $modulefile ]; then
insmod $modulefile $*
fi
fi fi
} }