Fix initialization

This commit is contained in:
Tom Eastep 2009-10-15 13:06:04 -07:00
parent 6e6063f193
commit 44c5ebcfa4
2 changed files with 24 additions and 7 deletions

View File

@ -230,14 +230,24 @@ sub generate_script_2() {
'[ -d ${VARDIR} ] || mkdir -p ${VARDIR}' '[ -d ${VARDIR} ] || mkdir -p ${VARDIR}'
); );
pop_indent;
emit "\n}\n"; # End of initialize()
emit( '' ,
'#' ,
'# Set global variables holding detected IP information' ,
'#' ,
'detect_configuration()',
'{' );
my $global_variables = have_global_variables; my $global_variables = have_global_variables;
if ( $global_variables ) { if ( $global_variables ) {
emit( '' ,
'#' , push_indent;
'# Set global variables holding detected IP information' ,
'#' , emit( 'case $COMMAND in' );
'case $COMMAND in' );
push_indent; push_indent;
@ -273,12 +283,14 @@ sub generate_script_2() {
pop_indent; pop_indent;
emit ( 'esac' ) , emit ( 'esac' ) ,
} else {
emit( 'true' );
} }
pop_indent; pop_indent;
emit "\n}\n"; # End of initialize() emit "\n}\n"; # End of detect_configuration()
} }
# #

View File

@ -362,6 +362,7 @@ case "$COMMAND" in
status=0 status=0
else else
progress_message3 "Starting $PRODUCT...." progress_message3 "Starting $PRODUCT...."
detect_configuration
define_firewall define_firewall
status=$? status=$?
[ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK [ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK
@ -371,6 +372,7 @@ case "$COMMAND" in
stop) stop)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
progress_message3 "Stopping $PRODUCT...." progress_message3 "Stopping $PRODUCT...."
detect_configuration
stop_firewall stop_firewall
status=0 status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK [ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
@ -414,6 +416,7 @@ case "$COMMAND" in
progress_message3 "Starting $PRODUCT...." progress_message3 "Starting $PRODUCT...."
fi fi
detect_configuration
define_firewall define_firewall
status=$? status=$?
if [ -n "$SUBSYSLOCK" ]; then if [ -n "$SUBSYSLOCK" ]; then
@ -425,6 +428,7 @@ case "$COMMAND" in
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if shorewall_is_started; then if shorewall_is_started; then
progress_message3 "Refreshing $PRODUCT...." progress_message3 "Refreshing $PRODUCT...."
detect_configuration
define_firewall define_firewall
status=$? status=$?
progress_message3 "done." progress_message3 "done."
@ -435,6 +439,7 @@ case "$COMMAND" in
;; ;;
restore) restore)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
detect_configuration
define_firewall define_firewall
status=$? status=$?
if [ -n "$SUBSYSLOCK" ]; then if [ -n "$SUBSYSLOCK" ]; then