Eliminate VERSION reserved variable name

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-03-02 08:02:10 -08:00
parent 5fc6d58e19
commit 3ea6f6792f
13 changed files with 65 additions and 66 deletions

View File

@ -55,7 +55,7 @@ PRODUCT="Shorewall Lite"
[ -n "$PATH" ] || PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin [ -n "$PATH" ] || PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
VERSION=$(cat /usr/share/shorewall-lite/version) SHOREWALL_VERSION=$(cat /usr/share/shorewall-lite/version)
[ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables) [ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables)

View File

@ -531,8 +531,7 @@ export PRODUCT="Shorewall Lite"
[ -d $VARDIR ] || mkdir -p $VARDIR || fatal_error "Unable to create $VARDIR" [ -d $VARDIR ] || mkdir -p $VARDIR || fatal_error "Unable to create $VARDIR"
LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli" LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
VERSION_FILE=$SHAREDIR/version version_file=$SHAREDIR/version
HELP=$SHAREDIR/help
for library in $LIBRARIES; do for library in $LIBRARIES; do
if [ -f $library ]; then if [ -f $library ]; then
@ -570,15 +569,15 @@ get_config
FIREWALL=$LITEDIR/firewall FIREWALL=$LITEDIR/firewall
if [ -f $VERSION_FILE ]; then if [ -f $version_file ]; then
version=$(cat $VERSION_FILE) SHOREWALL_VERSION=$(cat $SHOREWALL_VERSION_FILE)
else else
echo " ERROR: Shorewall Lite is not properly installed" >&2 echo " ERROR: Shorewall Lite is not properly installed" >&2
echo " The file $VERSION_FILE does not exist" >&2 echo " The file $version_file does not exist" >&2
exit 1 exit 1
fi fi
banner="Shorewall Lite $version Status at $HOSTNAME -" banner="Shorewall Lite $SHOREWALL_VERSION Status at $HOSTNAME -"
case $(echo -e) in case $(echo -e) in
-e*) -e*)
@ -628,7 +627,7 @@ case "$COMMAND" in
status) status)
[ $# -eq 1 ] || usage 1 [ $# -eq 1 ] || usage 1
[ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root" [ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root"
echo "Shorewall Lite $version Status at $HOSTNAME - $(date)" echo "Shorewall Lite $SHOREWALL_VERSION Status at $HOSTNAME - $(date)"
echo echo
if shorewall_is_started ; then if shorewall_is_started ; then
echo "Shorewall Lite is running" echo "Shorewall Lite is running"
@ -662,7 +661,7 @@ case "$COMMAND" in
hits_command $@ hits_command $@
;; ;;
version) version)
echo $version Lite echo $SHOREWALL_VERSION Lite
;; ;;
logwatch) logwatch)
logwatch_command $@ logwatch_command $@

View File

@ -219,7 +219,7 @@ sub generate_script_2() {
'[ -n "${VERBOSITY:=0}" ]', '[ -n "${VERBOSITY:=0}" ]',
qq([ -n "\${RESTOREFILE:=$config{RESTOREFILE}}" ]) ); qq([ -n "\${RESTOREFILE:=$config{RESTOREFILE}}" ]) );
emit ( qq(VERSION="$globals{VERSION}") ) unless $test; emit ( qq(SHOREWALL_VERSION="$globals{VERSION}") ) unless $test;
emit ( qq(PATH="$config{PATH}") , emit ( qq(PATH="$config{PATH}") ,
'TERMINATOR=fatal_error' , 'TERMINATOR=fatal_error' ,

View File

@ -213,7 +213,7 @@ case "$COMMAND" in
;; ;;
status) status)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)" echo "$PRODUCT-$SHORWEALL_VERSION Status at $HOSTNAME - $(date)"
echo echo
if shorewall_is_started; then if shorewall_is_started; then
echo "$PRODUCT is running" echo "$PRODUCT is running"
@ -238,7 +238,7 @@ case "$COMMAND" in
;; ;;
version) version)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
echo $VERSION echo $SHOREWALL_VERSION
status=0 status=0
;; ;;
help) help)

View File

@ -214,7 +214,7 @@ else
;; ;;
status) status)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)" echo "$PRODUCT-$SHOREWALL_VERSION Status at $HOSTNAME - $(date)"
echo echo
if shorewall6_is_started; then if shorewall6_is_started; then
echo "$PRODUCT is running" echo "$PRODUCT is running"
@ -239,7 +239,7 @@ else
;; ;;
version) version)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
echo $VERSION echo $SHOREWALL_VERSION
status=0 status=0
;; ;;
help) help)

View File

@ -1054,7 +1054,7 @@ report_capabilities1() {
} }
echo "#" echo "#"
echo "# Shorewall $VERSION detected the following iptables/netfilter capabilities - $(date)" echo "# Shorewall $SHOREWALL_VERSION detected the following iptables/netfilter capabilities - $(date)"
echo "#" echo "#"
report_capability1 NAT_ENABLED report_capability1 NAT_ENABLED
report_capability1 MANGLE_ENABLED report_capability1 MANGLE_ENABLED

View File

@ -514,34 +514,34 @@ show_command() {
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count) local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max) local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
echo "$PRODUCT $version Connections ($count out of $max) at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Connections ($count out of $max) at $HOSTNAME - $(date)"
echo echo
[ -f /proc/net/ip_conntrack ] && cat /proc/net/ip_conntrack || grep -v '^ipv6' /proc/net/nf_conntrack [ -f /proc/net/ip_conntrack ] && cat /proc/net/ip_conntrack || grep -v '^ipv6' /proc/net/nf_conntrack
;; ;;
nat) nat)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version NAT Table at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION NAT Table at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
$IPTABLES -t nat -L $g_ipt_options $IPTABLES -t nat -L $g_ipt_options
;; ;;
raw) raw)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version RAW Table at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION RAW Table at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
$IPTABLES -t raw -L $g_ipt_options $IPTABLES -t raw -L $g_ipt_options
;; ;;
tos|mangle) tos|mangle)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Mangle Table at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Mangle Table at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
$IPTABLES -t mangle -L $g_ipt_options $IPTABLES -t mangle -L $g_ipt_options
;; ;;
log) log)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Log ($LOGFILE) at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Log ($LOGFILE) at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
host=$(echo $HOSTNAME | sed 's/\..*$//') host=$(echo $HOSTNAME | sed 's/\..*$//')
@ -549,21 +549,21 @@ show_command() {
;; ;;
tc) tc)
[ $# -gt 2 ] && usage 1 [ $# -gt 2 ] && usage 1
echo "$PRODUCT $version Traffic Control at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Traffic Control at $HOSTNAME - $(date)"
echo echo
shift shift
show_tc $1 show_tc $1
;; ;;
classifiers|filters) classifiers|filters)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Classifiers at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Classifiers at $HOSTNAME - $(date)"
echo echo
show_classifiers show_classifiers
;; ;;
zones) zones)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
if [ -f ${VARDIR}/zones ]; then if [ -f ${VARDIR}/zones ]; then
echo "$PRODUCT $version Zones at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Zones at $HOSTNAME - $(date)"
echo echo
while read zone type hosts; do while read zone type hosts; do
echo "$zone ($type)" echo "$zone ($type)"
@ -596,13 +596,13 @@ show_command() {
;; ;;
ip) ip)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version IP at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION IP at $HOSTNAME - $(date)"
echo echo
ip -4 addr list ip -4 addr list
;; ;;
routing) routing)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Routing at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Routing at $HOSTNAME - $(date)"
echo echo
show_routing show_routing
;; ;;
@ -613,7 +613,7 @@ show_command() {
;; ;;
chain) chain)
shift shift
echo "$PRODUCT $version $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
@ -630,7 +630,7 @@ show_command() {
;; ;;
policies) policies)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Policies at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Policies at $HOSTNAME - $(date)"
echo echo
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies; [ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies;
;; ;;
@ -665,7 +665,7 @@ show_command() {
[ $# -ne 2 ] && usage 1 [ $# -ne 2 ] && usage 1
for directory in $(split $CONFIG_PATH); do for directory in $(split $CONFIG_PATH); do
if [ -f ${directory}/macro.$2 ]; then if [ -f ${directory}/macro.$2 ]; then
echo "Shorewall $version Macro $2 at $HOSTNAME - $(date)" echo "Shorewall $SHOREWALL_VERSION Macro $2 at $HOSTNAME - $(date)"
cat ${directory}/macro.$2 cat ${directory}/macro.$2
return return
fi fi
@ -715,7 +715,7 @@ show_command() {
fi fi
done done
echo "$PRODUCT $version $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
for chain in $*; do for chain in $*; do
@ -723,7 +723,7 @@ show_command() {
echo echo
done done
else else
echo "$PRODUCT $version $table Table at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION $table Table at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
$IPTABLES -t $table -L $g_ipt_options $IPTABLES -t $table -L $g_ipt_options
@ -783,7 +783,7 @@ dump_command() {
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || usage 1
clear_term clear_term
echo "$PRODUCT $version Dump at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Dump at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
@ -1276,7 +1276,7 @@ hits_command() {
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || usage 1
clear_term clear_term
echo "$PRODUCT $version Hits at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Hits at $HOSTNAME - $(date)"
echo echo
timeout=30 timeout=30

View File

@ -1568,7 +1568,7 @@ version_command() {
[ $# -gt 0 ] && usage 1 [ $# -gt 0 ] && usage 1
echo $version echo $SHOREWALL_VERSION
} }
@ -1608,14 +1608,14 @@ done
version_file=$SHAREDIR/version version_file=$SHAREDIR/version
if [ -f $version_file ]; then if [ -f $version_file ]; then
version=$(cat $version_file) SHOREWALL_VERSION=$(cat $version_file)
else else
echo " ERROR: Shorewall is not properly installed" >&2 echo " ERROR: Shorewall is not properly installed" >&2
echo " The file $version_file does not exist" >&2 echo " The file $version_file does not exist" >&2
exit 1 exit 1
fi fi
banner="Shorewall-$version Status at $HOSTNAME -" banner="Shorewall-$SHOREWALL_VERSION Status at $HOSTNAME -"
case $(echo -e) in case $(echo -e) in
-e*) -e*)
@ -1702,7 +1702,7 @@ case "$COMMAND" in
[ $# -eq 1 ] || usage 1 [ $# -eq 1 ] || usage 1
[ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root" [ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root"
get_config get_config
echo "Shorewall-$version Status at $HOSTNAME - $(date)" echo "Shorewall-$SHOREWALL_VERSION Status at $HOSTNAME - $(date)"
echo echo
if shorewall_is_started ; then if shorewall_is_started ; then
echo "Shorewall is running" echo "Shorewall is running"
@ -1748,7 +1748,7 @@ case "$COMMAND" in
;; ;;
logwatch) logwatch)
get_config Yes Yes Yes get_config Yes Yes Yes
banner="Shorewall-$version Logwatch at $HOSTNAME -" banner="Shorewall-$SHOREWALL_VERSION Logwatch at $HOSTNAME -"
logwatch_command $@ logwatch_command $@
;; ;;
drop) drop)

View File

@ -55,7 +55,7 @@ PRODUCT="Shorewall Lite"
[ -n "$PATH" ] || PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin [ -n "$PATH" ] || PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
VERSION=$(cat /usr/share/shorewall6-lite/version) SHOREWALL_VERSION=$(cat /usr/share/shorewall6-lite/version)
[ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables) [ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables)

View File

@ -516,7 +516,7 @@ export PRODUCT="Shorewall6 Lite"
[ -d $VARDIR ] || mkdir -p $VARDIR || fatal_error "Unable to create $VARDIR" [ -d $VARDIR ] || mkdir -p $VARDIR || fatal_error "Unable to create $VARDIR"
LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli" LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
VERSION_FILE=$SHAREDIR/version version_file=$SHAREDIR/version
HELP=$SHAREDIR/help HELP=$SHAREDIR/help
for library in $LIBRARIES; do for library in $LIBRARIES; do
@ -555,15 +555,15 @@ get_config
FIREWALL=$LITEDIR/firewall FIREWALL=$LITEDIR/firewall
if [ -f $VERSION_FILE ]; then if [ -f $version_file ]; then
version=$(cat $VERSION_FILE) SHOREWALL_VERSION=$(cat $version_file)
else else
echo " ERROR: Shorewall6 Lite is not properly installed" >&2 echo " ERROR: Shorewall6 Lite is not properly installed" >&2
echo " The file $VERSION_FILE does not exist" >&2 echo " The file $SHOREWALL_VERSION_FILE does not exist" >&2
exit 1 exit 1
fi fi
banner="Shorewall6 Lite $version Status at $HOSTNAME -" banner="Shorewall6 Lite $SHOREWALL_VERSION Status at $HOSTNAME -"
case $(echo -e) in case $(echo -e) in
-e*) -e*)
@ -609,7 +609,7 @@ case "$COMMAND" in
status) status)
[ $# -eq 1 ] || usage 1 [ $# -eq 1 ] || usage 1
[ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root" [ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root"
echo "Shorewall6 Lite $version Status at $HOSTNAME - $(date)" echo "Shorewall6 Lite $SHOREWALL_VERSION Status at $HOSTNAME - $(date)"
echo echo
if shorewall6_is_started ; then if shorewall6_is_started ; then
echo "Shorewall6 Lite is running" echo "Shorewall6 Lite is running"
@ -643,7 +643,7 @@ case "$COMMAND" in
hits_command $@ hits_command $@
;; ;;
version) version)
echo $version Lite echo $SHOREWALL_VERSION Lite
;; ;;
logwatch) logwatch)
logwatch_command $@ logwatch_command $@

View File

@ -958,7 +958,7 @@ report_capabilities1() {
} }
echo "#" echo "#"
echo "# Shorewall6 $VERSION detected the following ip6tables/netfilter capabilities - $(date)" echo "# Shorewall6 $SHOREWALL_VERSION detected the following ip6tables/netfilter capabilities - $(date)"
echo "#" echo "#"
report_capability1 MANGLE_ENABLED report_capability1 MANGLE_ENABLED
report_capability1 MULTIPORT report_capability1 MULTIPORT

View File

@ -427,27 +427,27 @@ show_command() {
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count) local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max) local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
echo "$PRODUCT $version Connections ($count of $max) at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Connections ($count of $max) at $HOSTNAME - $(date)"
echo echo
grep '^ipv6' /proc/net/nf_conntrack grep '^ipv6' /proc/net/nf_conntrack
;; ;;
tos|mangle) tos|mangle)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Mangle Table at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Mangle Table at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
$IP6TABLES -t mangle -L $g_ipt_options $IP6TABLES -t mangle -L $g_ipt_options
;; ;;
raw) raw)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version raw Table at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION raw Table at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
$IP6TABLES -t raw -L $g_ipt_options $IP6TABLES -t raw -L $g_ipt_options
;; ;;
log) log)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Log ($LOGFILE) at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Log ($LOGFILE) at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
host=$(echo $HOSTNAME | sed 's/\..*$//') host=$(echo $HOSTNAME | sed 's/\..*$//')
@ -455,20 +455,20 @@ show_command() {
;; ;;
tc) tc)
[ $# -gt 2 ] && usage 1 [ $# -gt 2 ] && usage 1
echo "$PRODUCT $version Traffic Control at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Traffic Control at $HOSTNAME - $(date)"
echo echo
show_tc show_tc
;; ;;
classifiers|filters) classifiers|filters)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Classifiers at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Classifiers at $HOSTNAME - $(date)"
echo echo
show_classifiers show_classifiers
;; ;;
zones) zones)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
if [ -f ${VARDIR}/zones ]; then if [ -f ${VARDIR}/zones ]; then
echo "$PRODUCT $version Zones at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Zones at $HOSTNAME - $(date)"
echo echo
while read zone type hosts; do while read zone type hosts; do
echo "$zone ($type)" echo "$zone ($type)"
@ -501,13 +501,13 @@ show_command() {
;; ;;
ip) ip)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version IP at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION IP at $HOSTNAME - $(date)"
echo echo
ip -6 addr list ip -6 addr list
;; ;;
routing) routing)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Routing at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Routing at $HOSTNAME - $(date)"
echo echo
show_routing show_routing
;; ;;
@ -518,7 +518,7 @@ show_command() {
;; ;;
chain) chain)
shift shift
echo "$PRODUCT $version $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
@ -534,7 +534,7 @@ show_command() {
;; ;;
policies) policies)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $version Policies at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Policies at $HOSTNAME - $(date)"
echo echo
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies; [ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies;
;; ;;
@ -592,14 +592,14 @@ show_command() {
fi fi
done done
echo "$PRODUCT $version $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
for chain in $*; do for chain in $*; do
$IP6TABLES -t $table -L $chain $g_ipt_options $IP6TABLES -t $table -L $chain $g_ipt_options
done done
else else
echo "$PRODUCT $version $table Table at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION $table Table at $HOSTNAME - $(date)"
echo echo
show_reset show_reset
$IP6TABLES -t $table -L $g_ipt_options $IP6TABLES -t $table -L $g_ipt_options
@ -659,7 +659,7 @@ dump_command() {
[ -n "$g_debugging" ] && set -x [ -n "$g_debugging" ] && set -x
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || usage 1
clear_term clear_term
echo "$PRODUCT $version Dump at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Dump at $HOSTNAME - $(date)"
echo echo
if [ -f /usr/share/shorewall/version ]; then if [ -f /usr/share/shorewall/version ]; then
@ -974,7 +974,7 @@ hits_command() {
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || usage 1
clear_term clear_term
echo "$PRODUCT $version Hits at $HOSTNAME - $(date)" echo "$PRODUCT $SHOREWALL_VERSION Hits at $HOSTNAME - $(date)"
echo echo
timeout=30 timeout=30

View File

@ -1476,7 +1476,7 @@ version_command() {
[ $# -gt 0 ] && usage 1 [ $# -gt 0 ] && usage 1
echo $version echo $SHOREWALL_VERSION
if [ -n "$all" ]; then if [ -n "$all" ]; then
if [ -f /usr/share/shorewall/version ]; then if [ -f /usr/share/shorewall/version ]; then
@ -1521,14 +1521,14 @@ done
version_file=$SHAREDIR/version version_file=$SHAREDIR/version
if [ -f $version_file ]; then if [ -f $version_file ]; then
version=$(cat $version_file) SHOREWALL_VERSION=$(cat $version_file)
else else
echo " ERROR: Shorewall6 is not properly installed" >&2 echo " ERROR: Shorewall6 is not properly installed" >&2
echo " The file $version_file does not exist" >&2 echo " The file $version_file does not exist" >&2
exit 1 exit 1
fi fi
banner="Shorewall6-$version Status at $HOSTNAME -" banner="Shorewall6-$SHOREWALL_VERSION Status at $HOSTNAME -"
case $(echo -e) in case $(echo -e) in
-e*) -e*)
@ -1615,7 +1615,7 @@ case "$COMMAND" in
[ $# -eq 1 ] || usage 1 [ $# -eq 1 ] || usage 1
[ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root" [ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root"
get_config get_config
echo "Shorewall6-$version Status at $HOSTNAME - $(date)" echo "Shorewall6-$SHOREWALL_VERSION Status at $HOSTNAME - $(date)"
echo echo
if shorewall6_is_started ; then if shorewall6_is_started ; then
echo "Shorewall6 is running" echo "Shorewall6 is running"
@ -1655,7 +1655,7 @@ case "$COMMAND" in
;; ;;
logwatch) logwatch)
get_config Yes Yes Yes get_config Yes Yes Yes
banner="Shorewall6-$version Logwatch at $HOSTNAME -" banner="Shorewall6-$SHOREWALL_VERSION Logwatch at $HOSTNAME -"
logwatch_command $@ logwatch_command $@
;; ;;
drop) drop)