forked from extern/shorewall_code
Only envoke 'clear' when STDOUT is a terminal
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1967 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
09e6003f0c
commit
3f6514a11f
@ -5,6 +5,9 @@ Changes in 2.2.2
|
|||||||
|
|
||||||
2) Enhanced support in the SOURCE column of /etc/shorewall/tcrules.
|
2) Enhanced support in the SOURCE column of /etc/shorewall/tcrules.
|
||||||
|
|
||||||
|
3) All calls to 'clear' are now conditional on the output device being
|
||||||
|
a terminal.
|
||||||
|
|
||||||
Changes in 2.2.1
|
Changes in 2.2.1
|
||||||
|
|
||||||
1) Add examples to the zones and policy files.
|
1) Add examples to the zones and policy files.
|
||||||
|
@ -9,9 +9,13 @@ Problems corrected in version 2.2.2
|
|||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
New Features in version 2.2.2
|
New Features in version 2.2.2
|
||||||
|
|
||||||
1) The SOURCE column in the /etc/shorewall/tcrules now allows $FW to
|
1) The SOURCE column in the /etc/shorewall/tcrules file now allows $FW
|
||||||
be optionally followed by ":" and a host/network address or address
|
to be optionally followed by ":" and a host/network address or
|
||||||
range.
|
address range.
|
||||||
|
|
||||||
|
2) Shorewall now clears the output device only if it is a
|
||||||
|
terminal. This avoids ugly control sequences being placed in files
|
||||||
|
when /sbin/shorewall output is redirected.
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
Problems corrected in version 2.2.1
|
Problems corrected in version 2.2.1
|
||||||
|
|
||||||
|
@ -220,6 +220,13 @@ get_config() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Clear descriptor 1 if it is a terminal
|
||||||
|
#
|
||||||
|
clear_term() {
|
||||||
|
[ -t 1 ] && clear
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Display IPTABLES rules -- we used to store them in a variable but ash
|
# Display IPTABLES rules -- we used to store them in a variable but ash
|
||||||
# dies when trying to display large sets of rules
|
# dies when trying to display large sets of rules
|
||||||
@ -238,7 +245,7 @@ display_chains()
|
|||||||
|
|
||||||
$IPTABLES -L $IPT_OPTIONS >> $TMPFILE
|
$IPTABLES -L $IPT_OPTIONS >> $TMPFILE
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
echo "Standard Chains"
|
echo "Standard Chains"
|
||||||
@ -250,7 +257,7 @@ display_chains()
|
|||||||
|
|
||||||
timed_read
|
timed_read
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
firstchain=Yes
|
firstchain=Yes
|
||||||
@ -268,7 +275,7 @@ display_chains()
|
|||||||
for zone in $zones; do
|
for zone in $zones; do
|
||||||
|
|
||||||
if [ -n "$(grep "^Chain \.*${zone}" $TMPFILE)" ] ; then
|
if [ -n "$(grep "^Chain \.*${zone}" $TMPFILE)" ] ; then
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
firstchain=Yes
|
firstchain=Yes
|
||||||
@ -287,7 +294,7 @@ display_chains()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
firstchain=Yes
|
firstchain=Yes
|
||||||
@ -308,7 +315,7 @@ display_chains()
|
|||||||
|
|
||||||
timed_read
|
timed_read
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
firstchain=Yes
|
firstchain=Yes
|
||||||
@ -443,7 +450,7 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that
|
|||||||
while true; do
|
while true; do
|
||||||
display_chains
|
display_chains
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -474,7 +481,7 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that
|
|||||||
timed_read
|
timed_read
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
echo "NAT Status"
|
echo "NAT Status"
|
||||||
@ -482,7 +489,7 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that
|
|||||||
$IPTABLES -t nat -L $IPT_OPTIONS
|
$IPTABLES -t nat -L $IPT_OPTIONS
|
||||||
timed_read
|
timed_read
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
@ -491,7 +498,7 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that
|
|||||||
$IPTABLES -t mangle -L $IPT_OPTIONS
|
$IPTABLES -t mangle -L $IPT_OPTIONS
|
||||||
timed_read
|
timed_read
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
@ -500,7 +507,7 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that
|
|||||||
cat /proc/net/ip_conntrack
|
cat /proc/net/ip_conntrack
|
||||||
timed_read
|
timed_read
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
@ -509,7 +516,7 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that
|
|||||||
show_tc
|
show_tc
|
||||||
timed_read
|
timed_read
|
||||||
|
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
@ -541,7 +548,7 @@ logwatch() # $1 = timeout -- if negative, prompt each time that
|
|||||||
qt which awk && haveawk=Yes || haveawk=
|
qt which awk && haveawk=Yes || haveawk=
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
clear
|
clear_term
|
||||||
echo "$banner $(date)"
|
echo "$banner $(date)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -960,7 +967,7 @@ case "$1" in
|
|||||||
status)
|
status)
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
[ $# -eq 1 ] || usage 1
|
[ $# -eq 1 ] || usage 1
|
||||||
clear
|
clear_term
|
||||||
echo "Shorewall-$version Status at $HOSTNAME - $(date)"
|
echo "Shorewall-$version Status at $HOSTNAME - $(date)"
|
||||||
echo
|
echo
|
||||||
show_reset
|
show_reset
|
||||||
@ -1029,7 +1036,7 @@ case "$1" in
|
|||||||
hits)
|
hits)
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
[ $# -eq 1 ] || usage 1
|
[ $# -eq 1 ] || usage 1
|
||||||
clear
|
clear_term
|
||||||
echo "Shorewall-$version Hits at $HOSTNAME - $(date)"
|
echo "Shorewall-$version Hits at $HOSTNAME - $(date)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user