forked from extern/shorewall_code
Eliminate running the script twice is some cases
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
846d629c47
commit
9f08726794
@ -4019,6 +4019,7 @@ shorewall_cli() {
|
||||
g_tcrules=
|
||||
g_counters=
|
||||
g_loopback=
|
||||
g_compiled=
|
||||
|
||||
VERBOSE=
|
||||
VERBOSITY=1
|
||||
|
@ -98,14 +98,22 @@ get_script_version() { # $1 = script
|
||||
local digits
|
||||
local verbosity
|
||||
|
||||
verbosity="$VERBOSITY"
|
||||
VERBOSITY=0
|
||||
if [ "$g_compiled" = "$g_file" ]; then
|
||||
#
|
||||
# Either this script was just compiled or AUTOMAKE determined that compilation wasn't needed
|
||||
#
|
||||
temp="$VERSION"
|
||||
else
|
||||
verbosity="$VERBOSITY"
|
||||
VERBOSITY=0
|
||||
|
||||
temp=$( $SHOREWALL_SHELL $1 version | tail -n 1 | sed 's/-.*//' )
|
||||
temp=$( $SHOREWALL_SHELL $1 version | tail -n 1 )
|
||||
fi
|
||||
|
||||
if [ -z "$temp" ]; then
|
||||
version=0
|
||||
else
|
||||
temp=${temp%-*}
|
||||
ifs=$IFS
|
||||
IFS=.
|
||||
temp=$(echo $temp)
|
||||
|
@ -100,6 +100,8 @@ g_sha1sum2=
|
||||
# Other Globals
|
||||
#
|
||||
g_counters=
|
||||
g_compiled=
|
||||
g_file=
|
||||
|
||||
initialize
|
||||
|
||||
|
@ -430,6 +430,7 @@ compiler() {
|
||||
|
||||
if [ -n "$g_conditional" ] && uptodate "$g_file"; then
|
||||
echo "$g_file is up to date -- no compilation required"
|
||||
g_compiled="$g_file"
|
||||
return 0
|
||||
fi
|
||||
|
||||
@ -472,7 +473,8 @@ compiler() {
|
||||
status=$?
|
||||
|
||||
if [ $status -eq 0 -a $COMMAND != check ]; then
|
||||
run_postcompile "$g_file"
|
||||
g_compiled="$g_file"
|
||||
run_postcompile "$g_compiled"
|
||||
return
|
||||
fi
|
||||
|
||||
@ -1227,8 +1229,6 @@ safe_commands() {
|
||||
exit $status
|
||||
fi
|
||||
|
||||
run_postcompile ${VARDIR}/.$command
|
||||
|
||||
case $command in
|
||||
start)
|
||||
RESTOREFILE=NONE
|
||||
|
Loading…
Reference in New Issue
Block a user