From c89d30211423281159deae2338eee7cf5887fc7a Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 16 Jul 2003 03:22:45 +0000 Subject: [PATCH] Streamline module loading git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@663 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/firewall | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/Shorewall/firewall b/Shorewall/firewall index d209272b5..718a01c30 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -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 }