Eliminate use of PRODUCT

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-03-02 12:34:36 -08:00
parent 5613d0105a
commit 2656a9b0c7
17 changed files with 112 additions and 112 deletions

View File

@ -48,7 +48,7 @@
SHAREDIR=/usr/share/shorewall-lite SHAREDIR=/usr/share/shorewall-lite
VARDIR=/var/lib/shorewall-lite VARDIR=/var/lib/shorewall-lite
CONFDIR=/etc/shorewall-lite CONFDIR=/etc/shorewall-lite
PRODUCT="Shorewall Lite" g_product="Shorewall Lite"
. /usr/share/shorewall-lite/lib.base . /usr/share/shorewall-lite/lib.base
. /usr/share/shorewall-lite/configpath . /usr/share/shorewall-lite/configpath

View File

@ -522,7 +522,7 @@ MUTEX_TIMEOUT=
SHAREDIR=/usr/share/shorewall-lite SHAREDIR=/usr/share/shorewall-lite
CONFDIR=/etc/shorewall-lite CONFDIR=/etc/shorewall-lite
export PRODUCT="Shorewall Lite" g_product="Shorewall Lite"
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ] [ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ]

View File

@ -167,24 +167,24 @@ sub generate_script_2() {
if ( $export ) { if ( $export ) {
emit ( 'SHAREDIR=/usr/share/shorewall-lite', emit ( 'SHAREDIR=/usr/share/shorewall-lite',
'CONFDIR=/etc/shorewall-lite', 'CONFDIR=/etc/shorewall-lite',
'PRODUCT="Shorewall Lite"' 'g_product="Shorewall Lite"'
); );
} else { } else {
emit ( 'SHAREDIR=/usr/share/shorewall', emit ( 'SHAREDIR=/usr/share/shorewall',
'CONFDIR=/etc/shorewall', 'CONFDIR=/etc/shorewall',
'PRODUCT=\'Shorewall\'', 'g_product=\'Shorewall\'',
); );
} }
} else { } else {
if ( $export ) { if ( $export ) {
emit ( 'SHAREDIR=/usr/share/shorewall6-lite', emit ( 'SHAREDIR=/usr/share/shorewall6-lite',
'CONFDIR=/etc/shorewall6-lite', 'CONFDIR=/etc/shorewall6-lite',
'PRODUCT="Shorewall6 Lite"' 'g_product="Shorewall6 Lite"'
); );
} else { } else {
emit ( 'SHAREDIR=/usr/share/shorewall6', emit ( 'SHAREDIR=/usr/share/shorewall6',
'CONFDIR=/etc/shorewall6', 'CONFDIR=/etc/shorewall6',
'PRODUCT=\'Shorewall6\'', 'g_product=\'Shorewall6\'',
); );
} }
} }
@ -540,16 +540,16 @@ date > ${VARDIR}/restarted
case $COMMAND in case $COMMAND in
start) start)
logger -p kern.info "$PRODUCT started" logger -p kern.info "$g_product started"
;; ;;
restart) restart)
logger -p kern.info "$PRODUCT restarted" logger -p kern.info "$g_product restarted"
;; ;;
refresh) refresh)
logger -p kern.info "$PRODUCT refreshed" logger -p kern.info "$g_product refreshed"
;; ;;
restore) restore)
logger -p kern.info "$PRODUCT restored" logger -p kern.info "$g_product restored"
;; ;;
esac esac
EOF EOF

View File

@ -2242,20 +2242,20 @@ EOF
case $COMMAND in case $COMMAND in
start) start)
logger -p kern.err "ERROR:$PRODUCT start failed" logger -p kern.err "ERROR:$g_product start failed"
;; ;;
restart) restart)
logger -p kern.err "ERROR:$PRODUCT restart failed" logger -p kern.err "ERROR:$g_product restart failed"
;; ;;
refresh) refresh)
logger -p kern.err "ERROR:$PRODUCT refresh failed" logger -p kern.err "ERROR:$g_product refresh failed"
;; ;;
esac esac
if [ "$RESTOREFILE" = NONE ]; then if [ "$RESTOREFILE" = NONE ]; then
COMMAND=clear COMMAND=clear
clear_firewall clear_firewall
echo "$PRODUCT Cleared" echo "$g_product Cleared"
kill $$ kill $$
exit 2 exit 2
@ -2263,13 +2263,13 @@ EOF
g_restorepath=${VARDIR}/$RESTOREFILE g_restorepath=${VARDIR}/$RESTOREFILE
if [ -x $g_restorepath ]; then if [ -x $g_restorepath ]; then
echo Restoring ${PRODUCT:=Shorewall}... echo Restoring ${g_product:=Shorewall}...
RECOVERING=Yes RECOVERING=Yes
export RECOVERING export RECOVERING
if $g_restorepath restore; then if $g_restorepath restore; then
echo "$PRODUCT restored from $g_restorepath" echo "$g_product restored from $g_restorepath"
set_state "Started" set_state "Started"
else else
set_state "Unknown" set_state "Unknown"
@ -2443,7 +2443,7 @@ EOF
emit ' emit '
set_state "Stopped" set_state "Stopped"
logger -p kern.info "$PRODUCT Stopped" logger -p kern.info "$g_product Stopped"
case $COMMAND in case $COMMAND in
stop|clear) stop|clear)

View File

@ -115,10 +115,10 @@ case "$COMMAND" in
start) start)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if shorewall_is_started; then if shorewall_is_started; then
error_message "$PRODUCT is already Running" error_message "$g_product is already Running"
status=0 status=0
else else
progress_message3 "Starting $PRODUCT...." progress_message3 "Starting $g_product...."
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
@ -128,7 +128,7 @@ case "$COMMAND" in
;; ;;
stop) stop)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
progress_message3 "Stopping $PRODUCT...." progress_message3 "Stopping $g_product...."
detect_configuration detect_configuration
stop_firewall stop_firewall
status=0 status=0
@ -137,7 +137,7 @@ case "$COMMAND" in
;; ;;
reset) reset)
if ! shorewall_is_started ; then if ! shorewall_is_started ; then
error_message "$PRODUCT is not running" error_message "$g_product is not running"
status=2 status=2
elif [ $# -eq 1 ]; then elif [ $# -eq 1 ]; then
$IPTABLES -Z $IPTABLES -Z
@ -145,7 +145,7 @@ case "$COMMAND" in
$IPTABLES -t mangle -Z $IPTABLES -t mangle -Z
date > ${VARDIR}/restarted date > ${VARDIR}/restarted
status=0 status=0
progress_message3 "$PRODUCT Counters Reset" progress_message3 "$g_product Counters Reset"
else else
shift shift
status=0 status=0
@ -167,10 +167,10 @@ case "$COMMAND" in
restart) restart)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if shorewall_is_started; then if shorewall_is_started; then
progress_message3 "Restarting $PRODUCT...." progress_message3 "Restarting $g_product...."
else else
error_message "$PRODUCT is not running" error_message "$g_product is not running"
progress_message3 "Starting $PRODUCT...." progress_message3 "Starting $g_product...."
fi fi
detect_configuration detect_configuration
@ -184,13 +184,13 @@ case "$COMMAND" in
refresh) refresh)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if shorewall_is_started; then if shorewall_is_started; then
progress_message3 "Refreshing $PRODUCT...." progress_message3 "Refreshing $g_product...."
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
progress_message3 "done." progress_message3 "done."
else else
echo "$PRODUCT is not running" >&2 echo "$g_product is not running" >&2
status=2 status=2
fi fi
;; ;;
@ -205,7 +205,7 @@ case "$COMMAND" in
;; ;;
clear) clear)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
progress_message3 "Clearing $PRODUCT...." progress_message3 "Clearing $g_product...."
clear_firewall clear_firewall
status=0 status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK [ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
@ -213,13 +213,13 @@ case "$COMMAND" in
;; ;;
status) status)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
echo "$PRODUCT-$SHORWEALL_VERSION Status at $(hostname) - $(date)" echo "$g_product-$SHORWEALL_VERSION Status at $(hostname) - $(date)"
echo echo
if shorewall_is_started; then if shorewall_is_started; then
echo "$PRODUCT is running" echo "$g_product is running"
status=0 status=0
else else
echo "$PRODUCT is stopped" echo "$g_product is stopped"
status=4 status=4
fi fi

View File

@ -110,17 +110,17 @@ COMMAND="$1"
kernel=$(printf "%2d%02d%02d" $(uname -r 2> /dev/null | sed -e 's/-.*//' -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/\1 \2 \3/g')) kernel=$(printf "%2d%02d%02d" $(uname -r 2> /dev/null | sed -e 's/-.*//' -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/\1 \2 \3/g'))
if [ $kernel -lt 20624 ]; then if [ $kernel -lt 20624 ]; then
error_message "ERROR: $PRODUCT requires Linux kernel 2.6.24 or later" error_message "ERROR: $g_product requires Linux kernel 2.6.24 or later"
status=2 status=2
else else
case "$COMMAND" in case "$COMMAND" in
start) start)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if shorewall6_is_started; then if shorewall6_is_started; then
error_message "$PRODUCT is already Running" error_message "$g_product is already Running"
status=0 status=0
else else
progress_message3 "Starting $PRODUCT...." progress_message3 "Starting $g_product...."
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
@ -130,7 +130,7 @@ else
;; ;;
stop) stop)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
progress_message3 "Stopping $PRODUCT...." progress_message3 "Stopping $g_product...."
detect_configuration detect_configuration
stop_firewall stop_firewall
status=0 status=0
@ -139,14 +139,14 @@ else
;; ;;
reset) reset)
if ! shorewall6_is_started ; then if ! shorewall6_is_started ; then
error_message "$PRODUCT is not running" error_message "$g_product is not running"
status=2 status=2
elif [ $# -eq 1 ]; then elif [ $# -eq 1 ]; then
$IP6TABLES -Z $IP6TABLES -Z
$IP6TABLES -t mangle -Z $IP6TABLES -t mangle -Z
date > ${VARDIR}/restarted date > ${VARDIR}/restarted
status=0 status=0
progress_message3 "$PRODUCT Counters Reset" progress_message3 "$g_product Counters Reset"
else else
shift shift
status=0 status=0
@ -168,10 +168,10 @@ else
restart) restart)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if shorewall6_is_started; then if shorewall6_is_started; then
progress_message3 "Restarting $PRODUCT...." progress_message3 "Restarting $g_product...."
else else
error_message "$PRODUCT is not running" error_message "$g_product is not running"
progress_message3 "Starting $PRODUCT...." progress_message3 "Starting $g_product...."
fi fi
detect_configuration detect_configuration
@ -185,13 +185,13 @@ else
refresh) refresh)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if shorewall6_is_started; then if shorewall6_is_started; then
progress_message3 "Refreshing $PRODUCT...." progress_message3 "Refreshing $g_product...."
detect_configuration detect_configuration
define_firewall define_firewall
status=$? status=$?
progress_message3 "done." progress_message3 "done."
else else
echo "$PRODUCT is not running" >&2 echo "$g_product is not running" >&2
status=2 status=2
fi fi
;; ;;
@ -206,7 +206,7 @@ else
;; ;;
clear) clear)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
progress_message3 "Clearing $PRODUCT...." progress_message3 "Clearing $g_product...."
clear_firewall clear_firewall
status=0 status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK [ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
@ -214,13 +214,13 @@ else
;; ;;
status) status)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
echo "$PRODUCT-$SHOREWALL_VERSION Status at $(hostname) - $(date)" echo "$g_product-$SHOREWALL_VERSION Status at $(hostname) - $(date)"
echo echo
if shorewall6_is_started; then if shorewall6_is_started; then
echo "$PRODUCT is running" echo "$g_product is running"
status=0 status=0
else else
echo "$PRODUCT is stopped" echo "$g_product is stopped"
status=4 status=4
fi fi

View File

@ -1114,7 +1114,7 @@ clear_firewall() {
set_state "Cleared" set_state "Cleared"
logger -p kern.info "$PRODUCT Cleared" logger -p kern.info "$g_product Cleared"
} }
# #
@ -1142,13 +1142,13 @@ startup_error() # $* = Error Message
echo " ERROR: $@: Firewall state not changed" >&2 echo " ERROR: $@: Firewall state not changed" >&2
case $COMMAND in case $COMMAND in
start) start)
logger -p kern.err "ERROR:$PRODUCT start failed:Firewall state not changed" logger -p kern.err "ERROR:$g_product start failed:Firewall state not changed"
;; ;;
restart) restart)
logger -p kern.err "ERROR:$PRODUCT restart failed:Firewall state not changed" logger -p kern.err "ERROR:$g_product restart failed:Firewall state not changed"
;; ;;
restore) restore)
logger -p kern.err "ERROR:$PRODUCT restore failed:Firewall state not changed" logger -p kern.err "ERROR:$g_product restore failed:Firewall state not changed"
;; ;;
esac esac
@ -1157,13 +1157,13 @@ startup_error() # $* = Error Message
case $COMMAND in case $COMMAND in
start) start)
echo "${timestamp} ERROR:$PRODUCT start failed:Firewall state not changed" >> $STARTUP_LOG echo "${timestamp} ERROR:$g_product start failed:Firewall state not changed" >> $STARTUP_LOG
;; ;;
restart) restart)
echo "${timestamp} ERROR:$PRODUCT restart failed:Firewall state not changed" >> $STARTUP_LOG echo "${timestamp} ERROR:$g_product restart failed:Firewall state not changed" >> $STARTUP_LOG
;; ;;
restore) restore)
echo "${timestamp} ERROR:$PRODUCT restore failed:Firewall state not changed" >> $STARTUP_LOG echo "${timestamp} ERROR:$g_product restore failed:Firewall state not changed" >> $STARTUP_LOG
;; ;;
esac esac
fi fi

View File

@ -965,7 +965,7 @@ clear_firewall() {
set_state "Cleared" set_state "Cleared"
logger -p kern.info "$PRODUCT Cleared" logger -p kern.info "$g_product Cleared"
} }
# #
@ -993,13 +993,13 @@ startup_error() # $* = Error Message
echo " ERROR: $@: Firewall state not changed" >&2 echo " ERROR: $@: Firewall state not changed" >&2
case $COMMAND in case $COMMAND in
start) start)
logger -p kern.err "ERROR:$PRODUCT start failed:Firewall state not changed" logger -p kern.err "ERROR:$g_product start failed:Firewall state not changed"
;; ;;
restart) restart)
logger -p kern.err "ERROR:$PRODUCT restart failed:Firewall state not changed" logger -p kern.err "ERROR:$g_product restart failed:Firewall state not changed"
;; ;;
restore) restore)
logger -p kern.err "ERROR:$PRODUCT restore failed:Firewall state not changed" logger -p kern.err "ERROR:$g_product restore failed:Firewall state not changed"
;; ;;
esac esac
@ -1008,13 +1008,13 @@ startup_error() # $* = Error Message
case $COMMAND in case $COMMAND in
start) start)
echo "${timestamp} ERROR:$PRODUCT start failed:Firewall state not changed" >> $STARTUP_LOG echo "${timestamp} ERROR:$g_product start failed:Firewall state not changed" >> $STARTUP_LOG
;; ;;
restart) restart)
echo "${timestamp} ERROR:$PRODUCT restart failed:Firewall state not changed" >> $STARTUP_LOG echo "${timestamp} ERROR:$g_product restart failed:Firewall state not changed" >> $STARTUP_LOG
;; ;;
restore) restore)
echo "${timestamp} ERROR:$PRODUCT restore failed:Firewall state not changed" >> $STARTUP_LOG echo "${timestamp} ERROR:$g_product restore failed:Firewall state not changed" >> $STARTUP_LOG
;; ;;
esac esac
fi fi

View File

@ -344,7 +344,7 @@ save_config() {
[ -d ${VARDIR} ] || mkdir -p ${VARDIR} [ -d ${VARDIR} ] || mkdir -p ${VARDIR}
if [ -f $g_restorepath -a ! -x $g_restorepath ]; then if [ -f $g_restorepath -a ! -x $g_restorepath ]; then
echo " ERROR: $g_restorepath exists and is not a saved $PRODUCT configuration" >&2 echo " ERROR: $g_restorepath exists and is not a saved $g_product configuration" >&2
else else
case $RESTOREFILE in case $RESTOREFILE in
capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones) capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones)
@ -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 $SHOREWALL_VERSION Connections ($count out of $max) at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Connections ($count out of $max) at $g_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 $SHOREWALL_VERSION NAT Table at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION NAT Table at $g_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 $SHOREWALL_VERSION RAW Table at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION RAW Table at $g_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 $SHOREWALL_VERSION Mangle Table at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Mangle Table at $g_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 $SHOREWALL_VERSION Log ($LOGFILE) at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Log ($LOGFILE) at $g_hostname - $(date)"
echo echo
show_reset show_reset
host=$(echo $g_hostname | sed 's/\..*$//') host=$(echo $g_hostname | sed 's/\..*$//')
@ -549,21 +549,21 @@ show_command() {
;; ;;
tc) tc)
[ $# -gt 2 ] && usage 1 [ $# -gt 2 ] && usage 1
echo "$PRODUCT $SHOREWALL_VERSION Traffic Control at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Traffic Control at $g_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 $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Classifiers at $g_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 $SHOREWALL_VERSION Zones at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Zones at $g_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 $SHOREWALL_VERSION IP at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION IP at $g_hostname - $(date)"
echo echo
ip -4 addr list ip -4 addr list
;; ;;
routing) routing)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $SHOREWALL_VERSION Routing at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
echo echo
show_routing show_routing
;; ;;
@ -613,7 +613,7 @@ show_command() {
;; ;;
chain) chain)
shift shift
echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $g_hostname - $(date)"
echo echo
show_reset show_reset
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
@ -630,12 +630,12 @@ show_command() {
;; ;;
policies) policies)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $SHOREWALL_VERSION Policies at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
echo echo
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies; [ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies;
;; ;;
*) *)
if [ "$PRODUCT" = Shorewall ]; then if [ "$g_product" = Shorewall ]; then
case $1 in case $1 in
actions) actions)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
@ -715,7 +715,7 @@ show_command() {
fi fi
done done
echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $g_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 $SHOREWALL_VERSION $table Table at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION $table Table at $g_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 $SHOREWALL_VERSION Dump at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Dump at $g_hostname - $(date)"
echo echo
show_reset show_reset
@ -924,7 +924,7 @@ restore_command() {
if [ -x $g_restorepath ]; then if [ -x $g_restorepath ]; then
progress_message3 "Restoring Shorewall..." progress_message3 "Restoring Shorewall..."
$SHOREWALL_SHELL $g_restorepath restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE" $SHOREWALL_SHELL $g_restorepath restore && progress_message3 "$g_product restored from ${VARDIR}/$RESTOREFILE"
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
else else
@ -1020,7 +1020,7 @@ block() # $1 = command, $2 = Finished, $3 - $n addresses
finished=$2 finished=$2
if ! chain_exists dynamic; then if ! chain_exists dynamic; then
echo "Dynamic blacklisting is not enabled in the current $PRODUCT configuration" >&2 echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
exit 2 exit 2
fi fi
@ -1276,7 +1276,7 @@ hits_command() {
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || usage 1
clear_term clear_term
echo "$PRODUCT $SHOREWALL_VERSION Hits at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Hits at $g_hostname - $(date)"
echo echo
timeout=30 timeout=30
@ -1332,7 +1332,7 @@ allow_command() {
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && usage 1
if shorewall_is_started ; then if shorewall_is_started ; then
if ! chain_exists dynamic; then if ! chain_exists dynamic; then
echo "Dynamic blacklisting is not enabled in the current $PRODUCT configuration" >&2 echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2
exit 2 exit 2
fi fi
@ -1366,7 +1366,7 @@ allow_command() {
done done
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
else else
error_message "ERROR: $PRODUCT is not started" error_message "ERROR: $g_product is not started"
exit 2 exit 2
fi fi
} }

View File

@ -1583,7 +1583,7 @@ MUTEX_TIMEOUT=
SHAREDIR=/usr/share/shorewall SHAREDIR=/usr/share/shorewall
CONFDIR=/etc/shorewall CONFDIR=/etc/shorewall
export PRODUCT="Shorewall" g_product="Shorewall"
export RECOVERING= export RECOVERING=
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir [ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir
@ -1757,7 +1757,7 @@ case "$COMMAND" in
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && usage 1
if shorewall_is_started ; then if shorewall_is_started ; then
if ! chain_exists dynamic; then if ! chain_exists dynamic; then
echo "Dynamic blacklisting is not supported in the current $PRODUCT configuration" echo "Dynamic blacklisting is not supported in the current $g_product configuration"
exit 2 exit 2
fi fi
@ -1774,7 +1774,7 @@ case "$COMMAND" in
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && usage 1
if shorewall_is_started ; then if shorewall_is_started ; then
if ! chain_exists dynamic; then if ! chain_exists dynamic; then
echo "Dynamic blacklisting is not supported in the current $PRODUCT configuration" echo "Dynamic blacklisting is not supported in the current $g_product configuration"
exit 2 exit 2
fi fi

View File

@ -48,7 +48,7 @@
SHAREDIR=/usr/share/shorewall6-lite SHAREDIR=/usr/share/shorewall6-lite
VARDIR=/var/lib/shorewall6-lite VARDIR=/var/lib/shorewall6-lite
CONFDIR=/etc/shorewall6-lite CONFDIR=/etc/shorewall6-lite
PRODUCT="Shorewall Lite" g_product="Shorewall Lite"
. /usr/share/shorewall6-lite/lib.base . /usr/share/shorewall6-lite/lib.base
. /usr/share/shorewall6-lite/configpath . /usr/share/shorewall6-lite/configpath

View File

@ -507,7 +507,7 @@ MUTEX_TIMEOUT=
SHAREDIR=/usr/share/shorewall6-lite SHAREDIR=/usr/share/shorewall6-lite
CONFDIR=/etc/shorewall6-lite CONFDIR=/etc/shorewall6-lite
export PRODUCT="Shorewall6 Lite" g_product="Shorewall6 Lite"
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ] [ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ]

View File

@ -285,7 +285,7 @@ save_config() {
[ -d ${VARDIR} ] || mkdir -p ${VARDIR} [ -d ${VARDIR} ] || mkdir -p ${VARDIR}
if [ -f $g_restorepath -a ! -x $g_restorepath ]; then if [ -f $g_restorepath -a ! -x $g_restorepath ]; then
echo " ERROR: $g_restorepath exists and is not a saved $PRODUCT configuration" >&2 echo " ERROR: $g_restorepath exists and is not a saved $g_product configuration" >&2
else else
case $RESTOREFILE in case $RESTOREFILE in
capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones) capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones)
@ -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 $SHOREWALL_VERSION Connections ($count of $max) at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Connections ($count of $max) at $g_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 $SHOREWALL_VERSION Mangle Table at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Mangle Table at $g_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 $SHOREWALL_VERSION raw Table at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION raw Table at $g_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 $SHOREWALL_VERSION Log ($LOGFILE) at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Log ($LOGFILE) at $g_hostname - $(date)"
echo echo
show_reset show_reset
host=$(echo $g_hostname | sed 's/\..*$//') host=$(echo $g_hostname | sed 's/\..*$//')
@ -455,20 +455,20 @@ show_command() {
;; ;;
tc) tc)
[ $# -gt 2 ] && usage 1 [ $# -gt 2 ] && usage 1
echo "$PRODUCT $SHOREWALL_VERSION Traffic Control at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Traffic Control at $g_hostname - $(date)"
echo echo
show_tc show_tc
;; ;;
classifiers|filters) classifiers|filters)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Classifiers at $g_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 $SHOREWALL_VERSION Zones at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Zones at $g_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 $SHOREWALL_VERSION IP at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION IP at $g_hostname - $(date)"
echo echo
ip -6 addr list ip -6 addr list
;; ;;
routing) routing)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $SHOREWALL_VERSION Routing at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
echo echo
show_routing show_routing
;; ;;
@ -518,7 +518,7 @@ show_command() {
;; ;;
chain) chain)
shift shift
echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || [ $# -gt 0 ] && echo "Chain " || echo $table Table)$* at $g_hostname - $(date)"
echo echo
show_reset show_reset
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
@ -534,12 +534,12 @@ show_command() {
;; ;;
policies) policies)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
echo "$PRODUCT $SHOREWALL_VERSION Policies at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
echo echo
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies; [ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies;
;; ;;
*) *)
if [ "$PRODUCT" = Shorewall6 ]; then if [ "$g_product" = Shorewall6 ]; then
case $1 in case $1 in
actions) actions)
[ $# -gt 1 ] && usage 1 [ $# -gt 1 ] && usage 1
@ -592,14 +592,14 @@ show_command() {
fi fi
done done
echo "$PRODUCT $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION $([ $# -gt 1 ] && echo "Chains " || echo "Chain ")$* at $g_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 $SHOREWALL_VERSION $table Table at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION $table Table at $g_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 $SHOREWALL_VERSION Dump at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Dump at $g_hostname - $(date)"
echo echo
if [ -f /usr/share/shorewall/version ]; then if [ -f /usr/share/shorewall/version ]; then
@ -807,7 +807,7 @@ restore_command() {
progress_message3 "Restoring Shorewall6..." progress_message3 "Restoring Shorewall6..."
$SHOREWALL_SHELL $g_restorepath restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE" $SHOREWALL_SHELL $g_restorepath restore && progress_message3 "$g_product restored from ${VARDIR}/$RESTOREFILE"
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
else else
@ -903,7 +903,7 @@ block() # $1 = command, $2 = Finished, $3 - $n addresses
finished=$2 finished=$2
if ! chain_exists dynamic; then if ! chain_exists dynamic; then
echo "Dynamic blacklisting is not enabled in the current $PRODUCT configuration" >&2 echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
exit 2 exit 2
fi fi
@ -974,7 +974,7 @@ hits_command() {
[ $# -eq 0 ] || usage 1 [ $# -eq 0 ] || usage 1
clear_term clear_term
echo "$PRODUCT $SHOREWALL_VERSION Hits at $g_hostname - $(date)" echo "$g_product $SHOREWALL_VERSION Hits at $g_hostname - $(date)"
echo echo
timeout=30 timeout=30
@ -1030,7 +1030,7 @@ allow_command() {
[ $# -eq 1 ] && usage 1 [ $# -eq 1 ] && usage 1
if shorewall6_is_started ; then if shorewall6_is_started ; then
if ! chain_exists dynamic; then if ! chain_exists dynamic; then
echo "Dynamic blacklisting is not enabled in the current $PRODUCT configuration" >&2 echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2
exit 2 exit 2
fi fi
@ -1064,7 +1064,7 @@ allow_command() {
done done
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
else else
error_message "ERROR: $PRODUCT is not started" error_message "ERROR: $g_product is not started"
exit 2 exit 2
fi fi
} }

View File

@ -1496,7 +1496,7 @@ MUTEX_TIMEOUT=
SHAREDIR=/usr/share/shorewall6 SHAREDIR=/usr/share/shorewall6
CONFDIR=/etc/shorewall6 CONFDIR=/etc/shorewall6
export PRODUCT="Shorewall6" g_product="Shorewall6"
export RECOVERING= export RECOVERING=
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir [ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir

View File

@ -643,7 +643,7 @@ SHELL cat /etc/shorewall/rules.d/*.rules</programlisting></para>
<member>PREVIEW</member> <member>PREVIEW</member>
<member><emphasis role="bold">PRODUCT</emphasis></member> <member>PRODUCT</member>
<member>PROFILE</member> <member>PROFILE</member>

View File

@ -60,7 +60,7 @@
<member>PREVIEW</member> <member>PREVIEW</member>
<member><emphasis role="bold">PRODUCT</emphasis></member> <member>PRODUCT</member>
<member>PROFILE</member> <member>PROFILE</member>

View File

@ -61,7 +61,7 @@
<member>PREVIEW</member> <member>PREVIEW</member>
<member><emphasis role="bold">PRODUCT</emphasis></member> <member>PRODUCT</member>
<member>PROFILE</member> <member>PROFILE</member>