mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 00:34:04 +01:00
Eliminate use of PRODUCT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
5613d0105a
commit
2656a9b0c7
@ -48,7 +48,7 @@
|
||||
SHAREDIR=/usr/share/shorewall-lite
|
||||
VARDIR=/var/lib/shorewall-lite
|
||||
CONFDIR=/etc/shorewall-lite
|
||||
PRODUCT="Shorewall Lite"
|
||||
g_product="Shorewall Lite"
|
||||
|
||||
. /usr/share/shorewall-lite/lib.base
|
||||
. /usr/share/shorewall-lite/configpath
|
||||
|
@ -522,7 +522,7 @@ MUTEX_TIMEOUT=
|
||||
|
||||
SHAREDIR=/usr/share/shorewall-lite
|
||||
CONFDIR=/etc/shorewall-lite
|
||||
export PRODUCT="Shorewall Lite"
|
||||
g_product="Shorewall Lite"
|
||||
|
||||
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ]
|
||||
|
||||
|
@ -167,24 +167,24 @@ sub generate_script_2() {
|
||||
if ( $export ) {
|
||||
emit ( 'SHAREDIR=/usr/share/shorewall-lite',
|
||||
'CONFDIR=/etc/shorewall-lite',
|
||||
'PRODUCT="Shorewall Lite"'
|
||||
'g_product="Shorewall Lite"'
|
||||
);
|
||||
} else {
|
||||
emit ( 'SHAREDIR=/usr/share/shorewall',
|
||||
'CONFDIR=/etc/shorewall',
|
||||
'PRODUCT=\'Shorewall\'',
|
||||
'g_product=\'Shorewall\'',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if ( $export ) {
|
||||
emit ( 'SHAREDIR=/usr/share/shorewall6-lite',
|
||||
'CONFDIR=/etc/shorewall6-lite',
|
||||
'PRODUCT="Shorewall6 Lite"'
|
||||
'g_product="Shorewall6 Lite"'
|
||||
);
|
||||
} else {
|
||||
emit ( 'SHAREDIR=/usr/share/shorewall6',
|
||||
'CONFDIR=/etc/shorewall6',
|
||||
'PRODUCT=\'Shorewall6\'',
|
||||
'g_product=\'Shorewall6\'',
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -540,16 +540,16 @@ date > ${VARDIR}/restarted
|
||||
|
||||
case $COMMAND in
|
||||
start)
|
||||
logger -p kern.info "$PRODUCT started"
|
||||
logger -p kern.info "$g_product started"
|
||||
;;
|
||||
restart)
|
||||
logger -p kern.info "$PRODUCT restarted"
|
||||
logger -p kern.info "$g_product restarted"
|
||||
;;
|
||||
refresh)
|
||||
logger -p kern.info "$PRODUCT refreshed"
|
||||
logger -p kern.info "$g_product refreshed"
|
||||
;;
|
||||
restore)
|
||||
logger -p kern.info "$PRODUCT restored"
|
||||
logger -p kern.info "$g_product restored"
|
||||
;;
|
||||
esac
|
||||
EOF
|
||||
|
@ -2242,20 +2242,20 @@ EOF
|
||||
|
||||
case $COMMAND in
|
||||
start)
|
||||
logger -p kern.err "ERROR:$PRODUCT start failed"
|
||||
logger -p kern.err "ERROR:$g_product start failed"
|
||||
;;
|
||||
restart)
|
||||
logger -p kern.err "ERROR:$PRODUCT restart failed"
|
||||
logger -p kern.err "ERROR:$g_product restart failed"
|
||||
;;
|
||||
refresh)
|
||||
logger -p kern.err "ERROR:$PRODUCT refresh failed"
|
||||
logger -p kern.err "ERROR:$g_product refresh failed"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$RESTOREFILE" = NONE ]; then
|
||||
COMMAND=clear
|
||||
clear_firewall
|
||||
echo "$PRODUCT Cleared"
|
||||
echo "$g_product Cleared"
|
||||
|
||||
kill $$
|
||||
exit 2
|
||||
@ -2263,13 +2263,13 @@ EOF
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
if [ -x $g_restorepath ]; then
|
||||
echo Restoring ${PRODUCT:=Shorewall}...
|
||||
echo Restoring ${g_product:=Shorewall}...
|
||||
|
||||
RECOVERING=Yes
|
||||
export RECOVERING
|
||||
|
||||
if $g_restorepath restore; then
|
||||
echo "$PRODUCT restored from $g_restorepath"
|
||||
echo "$g_product restored from $g_restorepath"
|
||||
set_state "Started"
|
||||
else
|
||||
set_state "Unknown"
|
||||
@ -2443,7 +2443,7 @@ EOF
|
||||
emit '
|
||||
set_state "Stopped"
|
||||
|
||||
logger -p kern.info "$PRODUCT Stopped"
|
||||
logger -p kern.info "$g_product Stopped"
|
||||
|
||||
case $COMMAND in
|
||||
stop|clear)
|
||||
|
@ -115,10 +115,10 @@ case "$COMMAND" in
|
||||
start)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
if shorewall_is_started; then
|
||||
error_message "$PRODUCT is already Running"
|
||||
error_message "$g_product is already Running"
|
||||
status=0
|
||||
else
|
||||
progress_message3 "Starting $PRODUCT...."
|
||||
progress_message3 "Starting $g_product...."
|
||||
detect_configuration
|
||||
define_firewall
|
||||
status=$?
|
||||
@ -128,7 +128,7 @@ case "$COMMAND" in
|
||||
;;
|
||||
stop)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
progress_message3 "Stopping $PRODUCT...."
|
||||
progress_message3 "Stopping $g_product...."
|
||||
detect_configuration
|
||||
stop_firewall
|
||||
status=0
|
||||
@ -137,7 +137,7 @@ case "$COMMAND" in
|
||||
;;
|
||||
reset)
|
||||
if ! shorewall_is_started ; then
|
||||
error_message "$PRODUCT is not running"
|
||||
error_message "$g_product is not running"
|
||||
status=2
|
||||
elif [ $# -eq 1 ]; then
|
||||
$IPTABLES -Z
|
||||
@ -145,7 +145,7 @@ case "$COMMAND" in
|
||||
$IPTABLES -t mangle -Z
|
||||
date > ${VARDIR}/restarted
|
||||
status=0
|
||||
progress_message3 "$PRODUCT Counters Reset"
|
||||
progress_message3 "$g_product Counters Reset"
|
||||
else
|
||||
shift
|
||||
status=0
|
||||
@ -167,10 +167,10 @@ case "$COMMAND" in
|
||||
restart)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
if shorewall_is_started; then
|
||||
progress_message3 "Restarting $PRODUCT...."
|
||||
progress_message3 "Restarting $g_product...."
|
||||
else
|
||||
error_message "$PRODUCT is not running"
|
||||
progress_message3 "Starting $PRODUCT...."
|
||||
error_message "$g_product is not running"
|
||||
progress_message3 "Starting $g_product...."
|
||||
fi
|
||||
|
||||
detect_configuration
|
||||
@ -184,13 +184,13 @@ case "$COMMAND" in
|
||||
refresh)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
if shorewall_is_started; then
|
||||
progress_message3 "Refreshing $PRODUCT...."
|
||||
progress_message3 "Refreshing $g_product...."
|
||||
detect_configuration
|
||||
define_firewall
|
||||
status=$?
|
||||
progress_message3 "done."
|
||||
else
|
||||
echo "$PRODUCT is not running" >&2
|
||||
echo "$g_product is not running" >&2
|
||||
status=2
|
||||
fi
|
||||
;;
|
||||
@ -205,7 +205,7 @@ case "$COMMAND" in
|
||||
;;
|
||||
clear)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
progress_message3 "Clearing $PRODUCT...."
|
||||
progress_message3 "Clearing $g_product...."
|
||||
clear_firewall
|
||||
status=0
|
||||
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
|
||||
@ -213,13 +213,13 @@ case "$COMMAND" in
|
||||
;;
|
||||
status)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
echo "$PRODUCT-$SHORWEALL_VERSION Status at $(hostname) - $(date)"
|
||||
echo "$g_product-$SHORWEALL_VERSION Status at $(hostname) - $(date)"
|
||||
echo
|
||||
if shorewall_is_started; then
|
||||
echo "$PRODUCT is running"
|
||||
echo "$g_product is running"
|
||||
status=0
|
||||
else
|
||||
echo "$PRODUCT is stopped"
|
||||
echo "$g_product is stopped"
|
||||
status=4
|
||||
fi
|
||||
|
||||
|
@ -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'))
|
||||
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
|
||||
else
|
||||
case "$COMMAND" in
|
||||
start)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
if shorewall6_is_started; then
|
||||
error_message "$PRODUCT is already Running"
|
||||
error_message "$g_product is already Running"
|
||||
status=0
|
||||
else
|
||||
progress_message3 "Starting $PRODUCT...."
|
||||
progress_message3 "Starting $g_product...."
|
||||
detect_configuration
|
||||
define_firewall
|
||||
status=$?
|
||||
@ -130,7 +130,7 @@ else
|
||||
;;
|
||||
stop)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
progress_message3 "Stopping $PRODUCT...."
|
||||
progress_message3 "Stopping $g_product...."
|
||||
detect_configuration
|
||||
stop_firewall
|
||||
status=0
|
||||
@ -139,14 +139,14 @@ else
|
||||
;;
|
||||
reset)
|
||||
if ! shorewall6_is_started ; then
|
||||
error_message "$PRODUCT is not running"
|
||||
error_message "$g_product is not running"
|
||||
status=2
|
||||
elif [ $# -eq 1 ]; then
|
||||
$IP6TABLES -Z
|
||||
$IP6TABLES -t mangle -Z
|
||||
date > ${VARDIR}/restarted
|
||||
status=0
|
||||
progress_message3 "$PRODUCT Counters Reset"
|
||||
progress_message3 "$g_product Counters Reset"
|
||||
else
|
||||
shift
|
||||
status=0
|
||||
@ -168,10 +168,10 @@ else
|
||||
restart)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
if shorewall6_is_started; then
|
||||
progress_message3 "Restarting $PRODUCT...."
|
||||
progress_message3 "Restarting $g_product...."
|
||||
else
|
||||
error_message "$PRODUCT is not running"
|
||||
progress_message3 "Starting $PRODUCT...."
|
||||
error_message "$g_product is not running"
|
||||
progress_message3 "Starting $g_product...."
|
||||
fi
|
||||
|
||||
detect_configuration
|
||||
@ -185,13 +185,13 @@ else
|
||||
refresh)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
if shorewall6_is_started; then
|
||||
progress_message3 "Refreshing $PRODUCT...."
|
||||
progress_message3 "Refreshing $g_product...."
|
||||
detect_configuration
|
||||
define_firewall
|
||||
status=$?
|
||||
progress_message3 "done."
|
||||
else
|
||||
echo "$PRODUCT is not running" >&2
|
||||
echo "$g_product is not running" >&2
|
||||
status=2
|
||||
fi
|
||||
;;
|
||||
@ -206,7 +206,7 @@ else
|
||||
;;
|
||||
clear)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
progress_message3 "Clearing $PRODUCT...."
|
||||
progress_message3 "Clearing $g_product...."
|
||||
clear_firewall
|
||||
status=0
|
||||
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
|
||||
@ -214,13 +214,13 @@ else
|
||||
;;
|
||||
status)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
echo "$PRODUCT-$SHOREWALL_VERSION Status at $(hostname) - $(date)"
|
||||
echo "$g_product-$SHOREWALL_VERSION Status at $(hostname) - $(date)"
|
||||
echo
|
||||
if shorewall6_is_started; then
|
||||
echo "$PRODUCT is running"
|
||||
echo "$g_product is running"
|
||||
status=0
|
||||
else
|
||||
echo "$PRODUCT is stopped"
|
||||
echo "$g_product is stopped"
|
||||
status=4
|
||||
fi
|
||||
|
||||
|
@ -1114,7 +1114,7 @@ clear_firewall() {
|
||||
|
||||
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
|
||||
case $COMMAND in
|
||||
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)
|
||||
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)
|
||||
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
|
||||
|
||||
@ -1157,13 +1157,13 @@ startup_error() # $* = Error Message
|
||||
|
||||
case $COMMAND in
|
||||
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)
|
||||
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)
|
||||
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
|
||||
fi
|
||||
|
@ -965,7 +965,7 @@ clear_firewall() {
|
||||
|
||||
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
|
||||
case $COMMAND in
|
||||
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)
|
||||
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)
|
||||
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
|
||||
|
||||
@ -1008,13 +1008,13 @@ startup_error() # $* = Error Message
|
||||
|
||||
case $COMMAND in
|
||||
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)
|
||||
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)
|
||||
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
|
||||
fi
|
||||
|
@ -344,7 +344,7 @@ save_config() {
|
||||
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
||||
|
||||
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
|
||||
case $RESTOREFILE in
|
||||
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
|
||||
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
|
||||
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
|
||||
[ -f /proc/net/ip_conntrack ] && cat /proc/net/ip_conntrack || grep -v '^ipv6' /proc/net/nf_conntrack
|
||||
;;
|
||||
nat)
|
||||
[ $# -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
|
||||
show_reset
|
||||
$IPTABLES -t nat -L $g_ipt_options
|
||||
;;
|
||||
raw)
|
||||
[ $# -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
|
||||
show_reset
|
||||
$IPTABLES -t raw -L $g_ipt_options
|
||||
;;
|
||||
tos|mangle)
|
||||
[ $# -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
|
||||
show_reset
|
||||
$IPTABLES -t mangle -L $g_ipt_options
|
||||
;;
|
||||
log)
|
||||
[ $# -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
|
||||
show_reset
|
||||
host=$(echo $g_hostname | sed 's/\..*$//')
|
||||
@ -549,21 +549,21 @@ show_command() {
|
||||
;;
|
||||
tc)
|
||||
[ $# -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
|
||||
shift
|
||||
show_tc $1
|
||||
;;
|
||||
classifiers|filters)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)"
|
||||
echo
|
||||
show_classifiers
|
||||
;;
|
||||
zones)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
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
|
||||
while read zone type hosts; do
|
||||
echo "$zone ($type)"
|
||||
@ -596,13 +596,13 @@ show_command() {
|
||||
;;
|
||||
ip)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION IP at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION IP at $g_hostname - $(date)"
|
||||
echo
|
||||
ip -4 addr list
|
||||
;;
|
||||
routing)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
|
||||
echo
|
||||
show_routing
|
||||
;;
|
||||
@ -613,7 +613,7 @@ show_command() {
|
||||
;;
|
||||
chain)
|
||||
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
|
||||
show_reset
|
||||
if [ $# -gt 0 ]; then
|
||||
@ -630,12 +630,12 @@ show_command() {
|
||||
;;
|
||||
policies)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
|
||||
echo
|
||||
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies;
|
||||
;;
|
||||
*)
|
||||
if [ "$PRODUCT" = Shorewall ]; then
|
||||
if [ "$g_product" = Shorewall ]; then
|
||||
case $1 in
|
||||
actions)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
@ -715,7 +715,7 @@ show_command() {
|
||||
fi
|
||||
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
|
||||
show_reset
|
||||
for chain in $*; do
|
||||
@ -723,7 +723,7 @@ show_command() {
|
||||
echo
|
||||
done
|
||||
else
|
||||
echo "$PRODUCT $SHOREWALL_VERSION $table Table at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION $table Table at $g_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 $SHOREWALL_VERSION Dump at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Dump at $g_hostname - $(date)"
|
||||
echo
|
||||
|
||||
show_reset
|
||||
@ -924,7 +924,7 @@ restore_command() {
|
||||
if [ -x $g_restorepath ]; then
|
||||
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
|
||||
else
|
||||
@ -1020,7 +1020,7 @@ block() # $1 = command, $2 = Finished, $3 - $n addresses
|
||||
finished=$2
|
||||
|
||||
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
|
||||
exit 2
|
||||
fi
|
||||
@ -1276,7 +1276,7 @@ hits_command() {
|
||||
[ $# -eq 0 ] || usage 1
|
||||
|
||||
clear_term
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Hits at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Hits at $g_hostname - $(date)"
|
||||
echo
|
||||
|
||||
timeout=30
|
||||
@ -1332,7 +1332,7 @@ allow_command() {
|
||||
[ $# -eq 1 ] && usage 1
|
||||
if shorewall_is_started ; 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
|
||||
fi
|
||||
|
||||
@ -1366,7 +1366,7 @@ allow_command() {
|
||||
done
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
error_message "ERROR: $PRODUCT is not started"
|
||||
error_message "ERROR: $g_product is not started"
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
@ -1583,7 +1583,7 @@ MUTEX_TIMEOUT=
|
||||
|
||||
SHAREDIR=/usr/share/shorewall
|
||||
CONFDIR=/etc/shorewall
|
||||
export PRODUCT="Shorewall"
|
||||
g_product="Shorewall"
|
||||
export RECOVERING=
|
||||
|
||||
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir
|
||||
@ -1757,7 +1757,7 @@ case "$COMMAND" in
|
||||
[ $# -eq 1 ] && usage 1
|
||||
if shorewall_is_started ; 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
|
||||
fi
|
||||
|
||||
@ -1774,7 +1774,7 @@ case "$COMMAND" in
|
||||
[ $# -eq 1 ] && usage 1
|
||||
if shorewall_is_started ; 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
|
||||
fi
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
SHAREDIR=/usr/share/shorewall6-lite
|
||||
VARDIR=/var/lib/shorewall6-lite
|
||||
CONFDIR=/etc/shorewall6-lite
|
||||
PRODUCT="Shorewall Lite"
|
||||
g_product="Shorewall Lite"
|
||||
|
||||
. /usr/share/shorewall6-lite/lib.base
|
||||
. /usr/share/shorewall6-lite/configpath
|
||||
|
@ -507,7 +507,7 @@ MUTEX_TIMEOUT=
|
||||
|
||||
SHAREDIR=/usr/share/shorewall6-lite
|
||||
CONFDIR=/etc/shorewall6-lite
|
||||
export PRODUCT="Shorewall6 Lite"
|
||||
g_product="Shorewall6 Lite"
|
||||
|
||||
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ]
|
||||
|
||||
|
@ -285,7 +285,7 @@ save_config() {
|
||||
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
||||
|
||||
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
|
||||
case $RESTOREFILE in
|
||||
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
|
||||
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
|
||||
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
|
||||
grep '^ipv6' /proc/net/nf_conntrack
|
||||
;;
|
||||
tos|mangle)
|
||||
[ $# -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
|
||||
show_reset
|
||||
$IP6TABLES -t mangle -L $g_ipt_options
|
||||
;;
|
||||
raw)
|
||||
[ $# -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
|
||||
show_reset
|
||||
$IP6TABLES -t raw -L $g_ipt_options
|
||||
;;
|
||||
log)
|
||||
[ $# -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
|
||||
show_reset
|
||||
host=$(echo $g_hostname | sed 's/\..*$//')
|
||||
@ -455,20 +455,20 @@ show_command() {
|
||||
;;
|
||||
tc)
|
||||
[ $# -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
|
||||
show_tc
|
||||
;;
|
||||
classifiers|filters)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Classifiers at $g_hostname - $(date)"
|
||||
echo
|
||||
show_classifiers
|
||||
;;
|
||||
zones)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
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
|
||||
while read zone type hosts; do
|
||||
echo "$zone ($type)"
|
||||
@ -501,13 +501,13 @@ show_command() {
|
||||
;;
|
||||
ip)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION IP at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION IP at $g_hostname - $(date)"
|
||||
echo
|
||||
ip -6 addr list
|
||||
;;
|
||||
routing)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Routing at $g_hostname - $(date)"
|
||||
echo
|
||||
show_routing
|
||||
;;
|
||||
@ -518,7 +518,7 @@ show_command() {
|
||||
;;
|
||||
chain)
|
||||
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
|
||||
show_reset
|
||||
if [ $# -gt 0 ]; then
|
||||
@ -534,12 +534,12 @@ show_command() {
|
||||
;;
|
||||
policies)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Policies at $g_hostname - $(date)"
|
||||
echo
|
||||
[ -f ${VARDIR}/policies ] && cat ${VARDIR}/policies;
|
||||
;;
|
||||
*)
|
||||
if [ "$PRODUCT" = Shorewall6 ]; then
|
||||
if [ "$g_product" = Shorewall6 ]; then
|
||||
case $1 in
|
||||
actions)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
@ -592,14 +592,14 @@ show_command() {
|
||||
fi
|
||||
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
|
||||
show_reset
|
||||
for chain in $*; do
|
||||
$IP6TABLES -t $table -L $chain $g_ipt_options
|
||||
done
|
||||
else
|
||||
echo "$PRODUCT $SHOREWALL_VERSION $table Table at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION $table Table at $g_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 $SHOREWALL_VERSION Dump at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Dump at $g_hostname - $(date)"
|
||||
echo
|
||||
|
||||
if [ -f /usr/share/shorewall/version ]; then
|
||||
@ -807,7 +807,7 @@ restore_command() {
|
||||
|
||||
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
|
||||
else
|
||||
@ -903,7 +903,7 @@ block() # $1 = command, $2 = Finished, $3 - $n addresses
|
||||
finished=$2
|
||||
|
||||
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
|
||||
exit 2
|
||||
fi
|
||||
@ -974,7 +974,7 @@ hits_command() {
|
||||
[ $# -eq 0 ] || usage 1
|
||||
|
||||
clear_term
|
||||
echo "$PRODUCT $SHOREWALL_VERSION Hits at $g_hostname - $(date)"
|
||||
echo "$g_product $SHOREWALL_VERSION Hits at $g_hostname - $(date)"
|
||||
echo
|
||||
|
||||
timeout=30
|
||||
@ -1030,7 +1030,7 @@ allow_command() {
|
||||
[ $# -eq 1 ] && usage 1
|
||||
if shorewall6_is_started ; 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
|
||||
fi
|
||||
|
||||
@ -1064,7 +1064,7 @@ allow_command() {
|
||||
done
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
error_message "ERROR: $PRODUCT is not started"
|
||||
error_message "ERROR: $g_product is not started"
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
@ -1496,7 +1496,7 @@ MUTEX_TIMEOUT=
|
||||
|
||||
SHAREDIR=/usr/share/shorewall6
|
||||
CONFDIR=/etc/shorewall6
|
||||
export PRODUCT="Shorewall6"
|
||||
g_product="Shorewall6"
|
||||
export RECOVERING=
|
||||
|
||||
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir
|
||||
|
@ -643,7 +643,7 @@ SHELL cat /etc/shorewall/rules.d/*.rules</programlisting></para>
|
||||
|
||||
<member>PREVIEW</member>
|
||||
|
||||
<member><emphasis role="bold">PRODUCT</emphasis></member>
|
||||
<member>PRODUCT</member>
|
||||
|
||||
<member>PROFILE</member>
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
<member>PREVIEW</member>
|
||||
|
||||
<member><emphasis role="bold">PRODUCT</emphasis></member>
|
||||
<member>PRODUCT</member>
|
||||
|
||||
<member>PROFILE</member>
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
|
||||
<member>PREVIEW</member>
|
||||
|
||||
<member><emphasis role="bold">PRODUCT</emphasis></member>
|
||||
<member>PRODUCT</member>
|
||||
|
||||
<member>PROFILE</member>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user