From 45bbd5413d836a480afa8d5b468376eff15aa574 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 25 Jan 2007 18:56:24 +0000 Subject: [PATCH] Better fix for missing $VARDIR git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5301 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-lite/shorecap | 2 +- Shorewall/compiler | 4 ++-- Shorewall/lib.base | 11 +++++++---- Shorewall/lib.config | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Shorewall-lite/shorecap b/Shorewall-lite/shorecap index bb26d5637..9509cbae4 100755 --- a/Shorewall-lite/shorecap +++ b/Shorewall-lite/shorecap @@ -59,6 +59,6 @@ VERSION=$(cat /usr/share/shorewall-lite/version) [ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables) VERBOSE=0 -load_kernel_modules +load_kernel_modules No determine_capabilities report_capabilities1 diff --git a/Shorewall/compiler b/Shorewall/compiler index 8ae766f1b..4dc72caf7 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -5180,10 +5180,10 @@ __EOF__ save_command_unindented EOF save_command "reload_kernel_modules < \${VARDIR}/.modules" else - save_command load_kernel_modules + save_command load_kernel_modules Yes fi else - save_command load_kernel_modules + save_command load_kernel_modules Yes fi for interface in $ALL_INTERFACES; do diff --git a/Shorewall/lib.base b/Shorewall/lib.base index ce2957db9..9435f3912 100644 --- a/Shorewall/lib.base +++ b/Shorewall/lib.base @@ -243,7 +243,7 @@ reload_kernel_modules() { # # Load kernel modules required for Shorewall # -load_kernel_modules() +load_kernel_modules() # $1 = Yes, if we are to save moduleinfo in $VARDIR { local save_modules_dir=$MODULESDIR local directory @@ -267,10 +267,13 @@ load_kernel_modules() MODULES=$(lsmod | cut -d ' ' -f1) progress_message "Loading Modules..." . $modules + if [ "$1" = Yes ]; then + [ -d ${VARDIR} ] || mkdir -p ${VARDIR} + echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir + cp -f $modules ${VARDIR}/.modules + fi + elif [ "$1" = Yes ]; then [ -d ${VARDIR} ] || mkdir -p ${VARDIR} - echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir - cp -f $modules ${VARDIR}/.modules - else > ${VARDIR}/.modulesdir > ${VARDIR}/.modules fi diff --git a/Shorewall/lib.config b/Shorewall/lib.config index b1bfc5c75..fd225a753 100644 --- a/Shorewall/lib.config +++ b/Shorewall/lib.config @@ -1902,7 +1902,7 @@ do_initialize() { if [ -z "$EXPORT" -a "$(whoami)" = root ]; then - load_kernel_modules + load_kernel_modules Yes if [ -z "$IPTABLES" ]; then IPTABLES=$(mywhich iptables 2> /dev/null)