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 modulefile
|
||||
local suffix
|
||||
|
||||
if [ -z "`lsmod | grep $modulename`" ]; then
|
||||
shift
|
||||
modulefile=$MODULESDIR/${modulename}.o
|
||||
|
||||
for suffix in o gz ko ; do
|
||||
modulefile=$MODULESDIR/${modulename}.${suffix}
|
||||
|
||||
if [ -f $modulefile ]; then
|
||||
insmod $modulefile $*
|
||||
return
|
||||
fi
|
||||
#
|
||||
# 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
|
||||
if [ -f $modulefile ]; then
|
||||
insmod $modulefile $*
|
||||
return
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user