mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-15 10:51:02 +01:00
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:
parent
0c8365f7bb
commit
c89d302114
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user