diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 06da6aeed..0292770e6 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -337,6 +337,7 @@ uptodate() { # Run the compiler # compiler() { + local pc pc=$g_libexec/shorewall/compiler.pl if [ $(id -u) -ne 0 ]; then @@ -870,6 +871,7 @@ refresh_command() { safe_commands() { local finished finished=0 + local command # test is the shell supports timed read read -t 0 junk 2> /dev/null @@ -972,7 +974,7 @@ safe_commands() { [ -n "$nolock" ] || mutex_on - if ${VARDIR}/.$command $g_debugging $command; then + if run_it ${VARDIR}/.$command $g_debugging $command; then echo -n "Do you want to accept the new firewall configuration? [y/n] " @@ -980,9 +982,9 @@ safe_commands() { echo "New configuration has been accepted" else if [ "$command" = "restart" ]; then - ${VARDIR}/.safe restore + run_it ${VARDIR}/.safe restore else - ${VARDIR}/.$command clear + run_it ${VARDIR}/.$command clear fi [ -n "$nolock" ] || mutex_off @@ -1108,13 +1110,13 @@ try_command() { [ -n "$nolock" ] || mutex_on - if ${VARDIR}/.$command $command && [ -n "$timeout" ]; then + if run_it ${VARDIR}/.$command $command && [ -n "$timeout" ]; then sleep $timeout if [ "$command" = "restart" ]; then - ${VARDIR}/.try restore + run_it ${VARDIR}/.try restore else - ${VARDIR}/.$command clear + run_it ${VARDIR}/.$command clear fi fi @@ -1669,9 +1671,9 @@ case "$COMMAND" in start_command $@ ;; stop|clear) - get_config [ $# -ne 1 ] && usage 1 - [ -x $g_firewall ] || fatal_error "Shorewall has never been started" + get_config + [ -x $g_firewall ] || fatal_error "Shorewall6 has never been started" [ -n "$nolock" ] || mutex_on run_it $g_firewall $g_debugging $COMMAND [ -n "$nolock" ] || mutex_off diff --git a/Shorewall6/shorewall6 b/Shorewall6/shorewall6 index 2d95a1fdc..9a685fd27 100755 --- a/Shorewall6/shorewall6 +++ b/Shorewall6/shorewall6 @@ -1261,7 +1261,7 @@ reload_command() # $* = original arguments less the command. [ -n "$g_timestamp" ] && timestamp='-t' || timestamp= - if shorewall6 $g_debugging $verbose $timestamp compile -e $compiler $directory $directory/firewall && \ + if shorewall6 $g_debugging $verbose $timestamp compile -e $directory $directory/firewall && \ progress_message3 "Copying $file and ${file}.conf to ${system}:${litedir}..." && \ rcp_command "$directory/firewall $directory/firewall.conf" ${litedir} then @@ -1348,7 +1348,7 @@ export_command() # $* = original arguments less the command. file=$(resolve_file $directory/firewall) - if shorewall6 $g_debugging $verbose compile -e $compiler $directory $directory/firewall && \ + if shorewall6 $g_debugging $verbose compile -e $directory $directory/firewall && \ echo "Copying $file and ${file}.conf to ${target#*@}..." && \ scp $directory/firewall $directory/firewall.conf $target then @@ -1391,8 +1391,23 @@ usage() # $1 = exit status echo " restart [ -n ] [ -p ] [-d] [ -f ] [ -c ][ ]" echo " restore [ -n ] [ ]" echo " save [ ]" - echo " show [ -x ] [ -m ] [-f] [ -t {filter|mangle} ] [ {chain [ [ ... ]|actions|capabilities|classifiers|config|connections|filters|ip|log []|macros|mangle|nat|policies|raw|routing|tc|vardir|zones} ]" - echo " start [ -f ] [ -n ] [ ]" + echo " show [ -x ] [ -t {filter|mangle|nat} ] [ {chain [ [ ... ]" + echo " show actions" + echo " show [ -f ] capabilities" + echo " show classifiers" + echo " show config" + echo " show connections" + echo " show filters" + echo " show ip" + echo " show [ -m ] log []" + echo " show macro " + echo " show macros" + echo " show [ -x ] mangle|raw|routing" + echo " show policies" + echo " show tc [ device ]" + echo " show vardir" + echo " show zones" + echo " start [ -f ] [ -n ] [ -p ] [ ]" echo " stop" echo " status" echo " try [ ]"