diff --git a/Shorewall/functions b/Shorewall/functions index f2cdaa553..621a7cf38 100755 --- a/Shorewall/functions +++ b/Shorewall/functions @@ -83,14 +83,15 @@ find_display() # $1 = zone, $2 = name of the zone file [ "x$1" = "x$z" ] && echo $display done } - +# +# This function assumes that the TMP_DIR variable is set and that +# its value named an existing directory. +# determine_zones() { local zonefile=`find_file zones` multi_display=Multi-zone - - [ -z "$TMP_DIR" ] && TMP_DIR=/tmp strip_file zones $zonefile zones=`find_zones $TMP_DIR/zones` zones=`echo $zones` # Remove extra trash @@ -99,8 +100,6 @@ determine_zones() dsply=`find_display $zone $TMP_DIR/zones` eval ${zone}_display=\$dsply done - - rm -f $TMP_DIR/zones } # diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 28531439a..58f801f97 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -348,8 +348,14 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that timeout=$1 fi + TMP_DIR=/tmp/shorewall-$$ + + mkdir $TMP_DIR + qt which awk && { haveawk=Yes; determine_zones; } || haveawk= + rm -rf $TMP_DIR + while true; do display_chains