Conserve space by removing comment decorations

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@311 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2002-10-23 16:48:40 +00:00
parent a997c16a42
commit 0eda4bab27
3 changed files with 525 additions and 522 deletions

File diff suppressed because it is too large Load Diff

View File

@ -80,17 +80,17 @@ determine_zones()
} }
############################################################################### #
# The following functions may be used by apps that wish to ensure that # The following functions may be used by apps that wish to ensure that
# the state of Shorewall isn't changing # the state of Shorewall isn't changing
#------------------------------------------------------------------------------ #
# This function loads the STATEDIR variable (directory where Shorewall is to # This function loads the STATEDIR variable (directory where Shorewall is to
# store state files). If your application supports alternate Shorewall # store state files). If your application supports alternate Shorewall
# configurations then the name of the alternate configuration directory should # configurations then the name of the alternate configuration directory should
# be in $SHOREWALL_DIR at the time of the call. # be in $SHOREWALL_DIR at the time of the call.
# #
# If the shorewall.conf file does not exist, this function does not return # If the shorewall.conf file does not exist, this function does not return
############################################################################### #
get_statedir() get_statedir()
{ {
MUTEX_TIMEOUT= MUTEX_TIMEOUT=
@ -107,7 +107,7 @@ get_statedir()
[ -z "${STATEDIR}" ] && STATEDIR=/var/state/shorewall [ -z "${STATEDIR}" ] && STATEDIR=/var/state/shorewall
} }
############################################################################### #
# Call this function to assert MUTEX with Shorewall. If you invoke the # Call this function to assert MUTEX with Shorewall. If you invoke the
# /sbin/shorewall program while holding MUTEX, you should pass "nolock" as # /sbin/shorewall program while holding MUTEX, you should pass "nolock" as
# the first argument. Example "shorewall nolock refresh" # the first argument. Example "shorewall nolock refresh"
@ -115,7 +115,7 @@ get_statedir()
# This function uses the lockfile utility from procmail if it exists. # This function uses the lockfile utility from procmail if it exists.
# Otherwise, it uses a somewhat race-prone algorithm to attempt to simulate the # Otherwise, it uses a somewhat race-prone algorithm to attempt to simulate the
# behavior of lockfile. # behavior of lockfile.
############################################################################### #
mutex_on() mutex_on()
{ {
local try=0 local try=0
@ -145,18 +145,18 @@ mutex_on()
fi fi
} }
############################################################################### #
# Call this function to release MUTEX # Call this function to release MUTEX
############################################################################### #
mutex_off() mutex_off()
{ {
rm -f $STATEDIR/lock rm -f $STATEDIR/lock
} }
############################################################################### #
# Strip comments and blank lines from a file and place the result in the # # Strip comments and blank lines from a file and place the result in the
# temporary directory # # temporary directory
############################################################################### #
strip_file() # $1 = Base Name of the file, $2 = Full Name of File (optional) strip_file() # $1 = Base Name of the file, $2 = Full Name of File (optional)
{ {
local fname local fname

View File

@ -110,9 +110,9 @@ showchain() # $1 = name of chain
fi fi
} }
################################################################################# #
# Set the configuration variables from shorewall.conf # # Set the configuration variables from shorewall.conf
################################################################################# #
get_config() { get_config() {
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages [ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
@ -134,10 +134,10 @@ get_config() {
[ -n "$FW" ] || FW=fw [ -n "$FW" ] || FW=fw
} }
################################################################################# #
# 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
################################################################################# #
display_chains() display_chains()
{ {
trap "rm -f /tmp/chains-$$; exit 1" 1 2 3 4 5 6 9 trap "rm -f /tmp/chains-$$; exit 1" 1 2 3 4 5 6 9
@ -227,10 +227,10 @@ display_chains()
} }
################################################################################# #
# Delay $timeout seconds -- if we're running on a recent bash2 then allow # # Delay $timeout seconds -- if we're running on a recent bash2 then allow
# <enter> to terminate the delay # # <enter> to terminate the delay
################################################################################# #
timed_read () timed_read ()
{ {
read -t $timeout foo 2> /dev/null read -t $timeout foo 2> /dev/null
@ -238,9 +238,9 @@ timed_read ()
test $? -eq 2 && sleep $timeout test $? -eq 2 && sleep $timeout
} }
################################################################################# #
# Display the last $1 packets logged # # Display the last $1 packets logged
################################################################################# #
packet_log() # $1 = number of messages packet_log() # $1 = number of messages
{ {
local options local options
@ -254,9 +254,9 @@ packet_log() # $1 = number of messages
tail $options tail $options
} }
################################################################################# #
# Show traffic control information # # Show traffic control information
################################################################################# #
show_tc() { show_tc() {
show_one_tc() { show_one_tc() {
@ -284,9 +284,9 @@ show_tc() {
} }
################################################################################# #
# Monitor the Firewall # # Monitor the Firewall
################################################################################# #
monitor_firewall() # $1 = timeout -- if negative, prompt each time that monitor_firewall() # $1 = timeout -- if negative, prompt each time that
# an 'interesting' packet count changes # an 'interesting' packet count changes
{ {
@ -360,9 +360,9 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that
done done
} }
################################################################################# #
# Watch the Firewall Log # # Watch the Firewall Log
################################################################################# #
logwatch() # $1 = timeout -- if negative, prompt each time that logwatch() # $1 = timeout -- if negative, prompt each time that
# an 'interesting' packet count changes # an 'interesting' packet count changes
{ {
@ -410,9 +410,9 @@ logwatch() # $1 = timeout -- if negative, prompt each time that
done done
} }
################################################################################# #
# Give Usage Information # # Give Usage Information
################################################################################# #
usage() # $1 = exit status usage() # $1 = exit status
{ {
echo "Usage: `basename $0` [debug] [nolock] [-c <directory>] <command>" echo "Usage: `basename $0` [debug] [nolock] [-c <directory>] <command>"
@ -440,17 +440,17 @@ usage() # $1 = exit status
exit $1 exit $1
} }
################################################################################# #
# Display the time that the counters were last reset # # Display the time that the counters were last reset
################################################################################# #
show_reset() { show_reset() {
[ -f $STATEDIR/restarted ] && \ [ -f $STATEDIR/restarted ] && \
echo -e "Counters reset `cat $STATEDIR/restarted`\\n" echo -e "Counters reset `cat $STATEDIR/restarted`\\n"
} }
################################################################################# #
# Execution begins here # # Execution begins here
################################################################################# #
debugging= debugging=
if [ $# -gt 0 ] && [ "$1" = "debug" ]; then if [ $# -gt 0 ] && [ "$1" = "debug" ]; then