diff --git a/Shorewall-lite/shorecap b/Shorewall-lite/shorecap index 24ff83268..6fa446578 100755 --- a/Shorewall-lite/shorecap +++ b/Shorewall-lite/shorecap @@ -55,7 +55,7 @@ PRODUCT="Shorewall Lite" [ -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) diff --git a/Shorewall-lite/shorewall-lite b/Shorewall-lite/shorewall-lite index 5b33981b3..0c11d60b3 100755 --- a/Shorewall-lite/shorewall-lite +++ b/Shorewall-lite/shorewall-lite @@ -531,8 +531,7 @@ export PRODUCT="Shorewall Lite" [ -d $VARDIR ] || mkdir -p $VARDIR || fatal_error "Unable to create $VARDIR" LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli" -VERSION_FILE=$SHAREDIR/version -HELP=$SHAREDIR/help +version_file=$SHAREDIR/version for library in $LIBRARIES; do if [ -f $library ]; then @@ -570,15 +569,15 @@ get_config FIREWALL=$LITEDIR/firewall -if [ -f $VERSION_FILE ]; then - version=$(cat $VERSION_FILE) +if [ -f $version_file ]; then + SHOREWALL_VERSION=$(cat $SHOREWALL_VERSION_FILE) else 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 fi -banner="Shorewall Lite $version Status at $HOSTNAME -" +banner="Shorewall Lite $SHOREWALL_VERSION Status at $HOSTNAME -" case $(echo -e) in -e*) @@ -628,7 +627,7 @@ case "$COMMAND" in status) [ $# -eq 1 ] || usage 1 [ "$(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 if shorewall_is_started ; then echo "Shorewall Lite is running" @@ -662,7 +661,7 @@ case "$COMMAND" in hits_command $@ ;; version) - echo $version Lite + echo $SHOREWALL_VERSION Lite ;; logwatch) logwatch_command $@ diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index 420b2ae53..1ed58efb0 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -219,7 +219,7 @@ sub generate_script_2() { '[ -n "${VERBOSITY:=0}" ]', 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}") , 'TERMINATOR=fatal_error' , diff --git a/Shorewall/Perl/prog.footer b/Shorewall/Perl/prog.footer index c82ac4496..c1194ee82 100644 --- a/Shorewall/Perl/prog.footer +++ b/Shorewall/Perl/prog.footer @@ -213,7 +213,7 @@ case "$COMMAND" in ;; status) [ $# -ne 1 ] && usage 2 - echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)" + echo "$PRODUCT-$SHORWEALL_VERSION Status at $HOSTNAME - $(date)" echo if shorewall_is_started; then echo "$PRODUCT is running" @@ -238,7 +238,7 @@ case "$COMMAND" in ;; version) [ $# -ne 1 ] && usage 2 - echo $VERSION + echo $SHOREWALL_VERSION status=0 ;; help) diff --git a/Shorewall/Perl/prog.footer6 b/Shorewall/Perl/prog.footer6 index 102aee4d0..547c463c2 100644 --- a/Shorewall/Perl/prog.footer6 +++ b/Shorewall/Perl/prog.footer6 @@ -214,7 +214,7 @@ else ;; status) [ $# -ne 1 ] && usage 2 - echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)" + echo "$PRODUCT-$SHOREWALL_VERSION Status at $HOSTNAME - $(date)" echo if shorewall6_is_started; then echo "$PRODUCT is running" @@ -239,7 +239,7 @@ else ;; version) [ $# -ne 1 ] && usage 2 - echo $VERSION + echo $SHOREWALL_VERSION status=0 ;; help) diff --git a/Shorewall/lib.base b/Shorewall/lib.base index a179545d1..d2e6dd9a0 100644 --- a/Shorewall/lib.base +++ b/Shorewall/lib.base @@ -1054,7 +1054,7 @@ report_capabilities1() { } echo "#" - echo "# Shorewall $VERSION detected the following iptables/netfilter capabilities - $(date)" + echo "# Shorewall $SHOREWALL_VERSION detected the following iptables/netfilter capabilities - $(date)" echo "#" report_capability1 NAT_ENABLED report_capability1 MANGLE_ENABLED diff --git a/Shorewall/lib.cli b/Shorewall/lib.cli index 65d69cf6e..6a349d7f7 100644 --- a/Shorewall/lib.cli +++ b/Shorewall/lib.cli @@ -514,34 +514,34 @@ show_command() { [ $# -gt 1 ] && usage 1 local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count) 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 [ -f /proc/net/ip_conntrack ] && cat /proc/net/ip_conntrack || grep -v '^ipv6' /proc/net/nf_conntrack ;; nat) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version NAT Table at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION NAT Table at $HOSTNAME - $(date)" echo show_reset $IPTABLES -t nat -L $g_ipt_options ;; raw) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version RAW Table at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION RAW Table at $HOSTNAME - $(date)" echo show_reset $IPTABLES -t raw -L $g_ipt_options ;; tos|mangle) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Mangle Table at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Mangle Table at $HOSTNAME - $(date)" echo show_reset $IPTABLES -t mangle -L $g_ipt_options ;; log) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Log ($LOGFILE) at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Log ($LOGFILE) at $HOSTNAME - $(date)" echo show_reset host=$(echo $HOSTNAME | sed 's/\..*$//') @@ -549,21 +549,21 @@ show_command() { ;; tc) [ $# -gt 2 ] && usage 1 - echo "$PRODUCT $version Traffic Control at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Traffic Control at $HOSTNAME - $(date)" echo shift show_tc $1 ;; classifiers|filters) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Classifiers at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Classifiers at $HOSTNAME - $(date)" echo show_classifiers ;; zones) [ $# -gt 1 ] && usage 1 if [ -f ${VARDIR}/zones ]; then - echo "$PRODUCT $version Zones at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Zones at $HOSTNAME - $(date)" echo while read zone type hosts; do echo "$zone ($type)" @@ -596,13 +596,13 @@ show_command() { ;; ip) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version IP at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION IP at $HOSTNAME - $(date)" echo ip -4 addr list ;; routing) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Routing at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Routing at $HOSTNAME - $(date)" echo show_routing ;; @@ -613,7 +613,7 @@ show_command() { ;; chain) 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 show_reset if [ $# -gt 0 ]; then @@ -630,7 +630,7 @@ show_command() { ;; policies) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Policies at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Policies at $HOSTNAME - $(date)" echo [ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies; ;; @@ -665,7 +665,7 @@ show_command() { [ $# -ne 2 ] && usage 1 for directory in $(split $CONFIG_PATH); do 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 return fi @@ -715,7 +715,7 @@ show_command() { fi 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 show_reset for chain in $*; do @@ -723,7 +723,7 @@ show_command() { echo done else - echo "$PRODUCT $version $table Table at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION $table Table at $HOSTNAME - $(date)" echo show_reset $IPTABLES -t $table -L $g_ipt_options @@ -783,7 +783,7 @@ dump_command() { [ -n "$g_debugging" ] && set -x [ $# -eq 0 ] || usage 1 clear_term - echo "$PRODUCT $version Dump at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Dump at $HOSTNAME - $(date)" echo show_reset @@ -1276,7 +1276,7 @@ hits_command() { [ $# -eq 0 ] || usage 1 clear_term - echo "$PRODUCT $version Hits at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Hits at $HOSTNAME - $(date)" echo timeout=30 diff --git a/Shorewall/shorewall b/Shorewall/shorewall index efaa7844b..7504613f3 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -1568,7 +1568,7 @@ version_command() { [ $# -gt 0 ] && usage 1 - echo $version + echo $SHOREWALL_VERSION } @@ -1608,14 +1608,14 @@ done version_file=$SHAREDIR/version if [ -f $version_file ]; then - version=$(cat $version_file) + SHOREWALL_VERSION=$(cat $version_file) else echo " ERROR: Shorewall is not properly installed" >&2 echo " The file $version_file does not exist" >&2 exit 1 fi -banner="Shorewall-$version Status at $HOSTNAME -" +banner="Shorewall-$SHOREWALL_VERSION Status at $HOSTNAME -" case $(echo -e) in -e*) @@ -1702,7 +1702,7 @@ case "$COMMAND" in [ $# -eq 1 ] || usage 1 [ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root" get_config - echo "Shorewall-$version Status at $HOSTNAME - $(date)" + echo "Shorewall-$SHOREWALL_VERSION Status at $HOSTNAME - $(date)" echo if shorewall_is_started ; then echo "Shorewall is running" @@ -1748,7 +1748,7 @@ case "$COMMAND" in ;; logwatch) get_config Yes Yes Yes - banner="Shorewall-$version Logwatch at $HOSTNAME -" + banner="Shorewall-$SHOREWALL_VERSION Logwatch at $HOSTNAME -" logwatch_command $@ ;; drop) diff --git a/Shorewall6-lite/shorecap b/Shorewall6-lite/shorecap index a06d5c0bf..1d9048a8a 100755 --- a/Shorewall6-lite/shorecap +++ b/Shorewall6-lite/shorecap @@ -55,7 +55,7 @@ PRODUCT="Shorewall Lite" [ -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) diff --git a/Shorewall6-lite/shorewall6-lite b/Shorewall6-lite/shorewall6-lite index f18010e9f..416672141 100755 --- a/Shorewall6-lite/shorewall6-lite +++ b/Shorewall6-lite/shorewall6-lite @@ -516,7 +516,7 @@ export PRODUCT="Shorewall6 Lite" [ -d $VARDIR ] || mkdir -p $VARDIR || fatal_error "Unable to create $VARDIR" LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli" -VERSION_FILE=$SHAREDIR/version +version_file=$SHAREDIR/version HELP=$SHAREDIR/help for library in $LIBRARIES; do @@ -555,15 +555,15 @@ get_config FIREWALL=$LITEDIR/firewall -if [ -f $VERSION_FILE ]; then - version=$(cat $VERSION_FILE) +if [ -f $version_file ]; then + SHOREWALL_VERSION=$(cat $version_file) else 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 fi -banner="Shorewall6 Lite $version Status at $HOSTNAME -" +banner="Shorewall6 Lite $SHOREWALL_VERSION Status at $HOSTNAME -" case $(echo -e) in -e*) @@ -609,7 +609,7 @@ case "$COMMAND" in status) [ $# -eq 1 ] || usage 1 [ "$(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 if shorewall6_is_started ; then echo "Shorewall6 Lite is running" @@ -643,7 +643,7 @@ case "$COMMAND" in hits_command $@ ;; version) - echo $version Lite + echo $SHOREWALL_VERSION Lite ;; logwatch) logwatch_command $@ diff --git a/Shorewall6/lib.base b/Shorewall6/lib.base index c9687f42e..c5b578426 100644 --- a/Shorewall6/lib.base +++ b/Shorewall6/lib.base @@ -958,7 +958,7 @@ report_capabilities1() { } echo "#" - echo "# Shorewall6 $VERSION detected the following ip6tables/netfilter capabilities - $(date)" + echo "# Shorewall6 $SHOREWALL_VERSION detected the following ip6tables/netfilter capabilities - $(date)" echo "#" report_capability1 MANGLE_ENABLED report_capability1 MULTIPORT diff --git a/Shorewall6/lib.cli b/Shorewall6/lib.cli index b5d4f34d4..ef63e329e 100644 --- a/Shorewall6/lib.cli +++ b/Shorewall6/lib.cli @@ -427,27 +427,27 @@ show_command() { [ $# -gt 1 ] && usage 1 local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count) 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 grep '^ipv6' /proc/net/nf_conntrack ;; tos|mangle) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Mangle Table at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Mangle Table at $HOSTNAME - $(date)" echo show_reset $IP6TABLES -t mangle -L $g_ipt_options ;; raw) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version raw Table at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION raw Table at $HOSTNAME - $(date)" echo show_reset $IP6TABLES -t raw -L $g_ipt_options ;; log) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Log ($LOGFILE) at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Log ($LOGFILE) at $HOSTNAME - $(date)" echo show_reset host=$(echo $HOSTNAME | sed 's/\..*$//') @@ -455,20 +455,20 @@ show_command() { ;; tc) [ $# -gt 2 ] && usage 1 - echo "$PRODUCT $version Traffic Control at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Traffic Control at $HOSTNAME - $(date)" echo show_tc ;; classifiers|filters) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Classifiers at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Classifiers at $HOSTNAME - $(date)" echo show_classifiers ;; zones) [ $# -gt 1 ] && usage 1 if [ -f ${VARDIR}/zones ]; then - echo "$PRODUCT $version Zones at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Zones at $HOSTNAME - $(date)" echo while read zone type hosts; do echo "$zone ($type)" @@ -501,13 +501,13 @@ show_command() { ;; ip) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version IP at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION IP at $HOSTNAME - $(date)" echo ip -6 addr list ;; routing) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Routing at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Routing at $HOSTNAME - $(date)" echo show_routing ;; @@ -518,7 +518,7 @@ show_command() { ;; chain) 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 show_reset if [ $# -gt 0 ]; then @@ -534,7 +534,7 @@ show_command() { ;; policies) [ $# -gt 1 ] && usage 1 - echo "$PRODUCT $version Policies at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Policies at $HOSTNAME - $(date)" echo [ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies; ;; @@ -592,14 +592,14 @@ show_command() { fi 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 show_reset for chain in $*; do $IP6TABLES -t $table -L $chain $g_ipt_options done else - echo "$PRODUCT $version $table Table at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION $table Table at $HOSTNAME - $(date)" echo show_reset $IP6TABLES -t $table -L $g_ipt_options @@ -659,7 +659,7 @@ dump_command() { [ -n "$g_debugging" ] && set -x [ $# -eq 0 ] || usage 1 clear_term - echo "$PRODUCT $version Dump at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Dump at $HOSTNAME - $(date)" echo if [ -f /usr/share/shorewall/version ]; then @@ -974,7 +974,7 @@ hits_command() { [ $# -eq 0 ] || usage 1 clear_term - echo "$PRODUCT $version Hits at $HOSTNAME - $(date)" + echo "$PRODUCT $SHOREWALL_VERSION Hits at $HOSTNAME - $(date)" echo timeout=30 diff --git a/Shorewall6/shorewall6 b/Shorewall6/shorewall6 index 6974f551f..c7f82090d 100755 --- a/Shorewall6/shorewall6 +++ b/Shorewall6/shorewall6 @@ -1476,7 +1476,7 @@ version_command() { [ $# -gt 0 ] && usage 1 - echo $version + echo $SHOREWALL_VERSION if [ -n "$all" ]; then if [ -f /usr/share/shorewall/version ]; then @@ -1521,14 +1521,14 @@ done version_file=$SHAREDIR/version if [ -f $version_file ]; then - version=$(cat $version_file) + SHOREWALL_VERSION=$(cat $version_file) else echo " ERROR: Shorewall6 is not properly installed" >&2 echo " The file $version_file does not exist" >&2 exit 1 fi -banner="Shorewall6-$version Status at $HOSTNAME -" +banner="Shorewall6-$SHOREWALL_VERSION Status at $HOSTNAME -" case $(echo -e) in -e*) @@ -1615,7 +1615,7 @@ case "$COMMAND" in [ $# -eq 1 ] || usage 1 [ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root" get_config - echo "Shorewall6-$version Status at $HOSTNAME - $(date)" + echo "Shorewall6-$SHOREWALL_VERSION Status at $HOSTNAME - $(date)" echo if shorewall6_is_started ; then echo "Shorewall6 is running" @@ -1655,7 +1655,7 @@ case "$COMMAND" in ;; logwatch) get_config Yes Yes Yes - banner="Shorewall6-$version Logwatch at $HOSTNAME -" + banner="Shorewall6-$SHOREWALL_VERSION Logwatch at $HOSTNAME -" logwatch_command $@ ;; drop)