AUTOMAKE also applies to 'restart'

Signed-off-by: Tom Eastep <teastep@shorewall.net>

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9768 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2009-03-31 18:54:00 +00:00
parent 6c205d922a
commit 238ff4550f
2 changed files with 41 additions and 23 deletions

View File

@ -90,11 +90,11 @@ None.
5) A new AUTOMAKE option has been added to shorewall.conf and
shorewall6.conf. When set to 'Yes', this option causes new behavior
during processing of the 'start' command; if no files in
/etc/shorewall/ (/etc/shorewall6) have changed since the last
during processing of the 'start' and 'restart' commands; if no
files in /etc/shorewall/ (/etc/shorewall6) have changed since the last
'start' or 'restart', then the compilation step is skipped and the
script used during the last 'start' or 'restart' is used to start
the firewall.
script used during the last 'start' or 'restart' is used to
start/restart the firewall.
Note that the 'make' utility must be installed on the firewall
system in order for AUTOMAKE=Yes to work correctly.

View File

@ -402,6 +402,7 @@ compiler() {
start_command() {
local finished
finished=0
local restorefile
do_it() {
local rc
@ -504,6 +505,8 @@ start_command() {
#
# RESTOREFILE is exported by get_config()
#
restorefile=$RESTOREFILE
if [ -z "$FAST" ]; then
#
# Autofast -- use the last compiled script
@ -515,6 +518,8 @@ start_command() {
FAST=
AUTOMAKE=
fi
RESTOREFILE=$restorefile
else
FAST=
AUTOMAKE=
@ -716,6 +721,7 @@ restart_command() {
finished=0
local rc
rc=0
local restorefile
while [ $finished -eq 0 -a $# -gt 0 ]; do
option=$1
@ -787,27 +793,39 @@ restart_command() {
export NOROUTES
export PURGE
if [ -z "$FAST" ]; then
progress_message3 "Compiling..."
if [ -z "$FAST" -a -n "$AUTOMAKE" ]; then
if qt mywhich make; then
#
# RESTOREFILE is exported by get_config()
#
restorefile=$RESTOREFILE
RESTOREFILE=firewall
make -qf ${CONFDIR}/Makefile && FAST=Yes
RESTOREFILE=$restorefile
fi
fi
if compiler $debugging $nolock compile ${VARDIR}/.restart; then
[ -n "$nolock" ] || mutex_on
$SHOREWALL_SHELL ${VARDIR}/.restart $debugging restart
rc=$?
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:Shorewall restart failed"
fi
else
[ -x ${VARDIR}/firewall ] || fatal_error "No ${VARDIR}/firewall file found"
[ -n "$nolock" ] || mutex_on
$SHOREWALL_SHELL ${VARDIR}/firewall $debugging restart
rc=$?
[ -n "$nolock" ] || mutex_off
fi
if [ -z "$FAST" ]; then
progress_message3 "Compiling..."
return $rc
if compiler $debugging $nolock compile ${VARDIR}/.restart; then
[ -n "$nolock" ] || mutex_on
$SHOREWALL_SHELL ${VARDIR}/.restart $debugging restart
rc=$?
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:Shorewall restart failed"
fi
else
[ -x ${VARDIR}/firewall ] || fatal_error "No ${VARDIR}/firewall file found"
[ -n "$nolock" ] || mutex_on
$SHOREWALL_SHELL ${VARDIR}/firewall $debugging restart
rc=$?
[ -n "$nolock" ] || mutex_off
fi
return $rc
}
#