mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-03 03:59:16 +01:00
Allow INITLOG to be set in /etc/default/shorewall[6]; fix syntax error in Zones module
This commit is contained in:
parent
be8b352ee7
commit
cb77458070
@ -1094,7 +1094,7 @@ sub process_host( ) {
|
|||||||
$type = IPSEC;
|
$type = IPSEC;
|
||||||
$zoneref->{options}{complex} = 1;
|
$zoneref->{options}{complex} = 1;
|
||||||
$ipsec = 1;
|
$ipsec = 1;
|
||||||
} elseif ( $option eq 'norfc1918' ) {
|
} elsif ( $option eq 'norfc1918' ) {
|
||||||
warning_message "The 'norfc1918' option is no longer supported"
|
warning_message "The 'norfc1918' option is no longer supported"
|
||||||
} elsif ( $validhostoptions{$option}) {
|
} elsif ( $validhostoptions{$option}) {
|
||||||
$options{$option} = 1;
|
$options{$option} = 1;
|
||||||
|
@ -14,13 +14,10 @@ usage() {
|
|||||||
#
|
#
|
||||||
# Start trace if first arg is "debug" or "trace"
|
# Start trace if first arg is "debug" or "trace"
|
||||||
#
|
#
|
||||||
tracing=
|
|
||||||
|
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
if [ "x$1" = "xtrace" ]; then
|
if [ "x$1" = "xtrace" ]; then
|
||||||
set -x
|
set -x
|
||||||
shift
|
shift
|
||||||
tracing=1
|
|
||||||
elif [ "x$1" = "xdebug" ]; then
|
elif [ "x$1" = "xdebug" ]; then
|
||||||
DEBUG=Yes
|
DEBUG=Yes
|
||||||
shift
|
shift
|
||||||
@ -30,17 +27,12 @@ fi
|
|||||||
initialize
|
initialize
|
||||||
|
|
||||||
if [ -n "$STARTUP_LOG" ]; then
|
if [ -n "$STARTUP_LOG" ]; then
|
||||||
if [ -a ${SHOREWALL_INIT_SCRIPT:-0} -eq 1 ]; then
|
if [ ${SHOREWALL_INIT_SCRIPT:-0} -eq 1 ]; then
|
||||||
#
|
#
|
||||||
# We're being run by a startup script that isn't redirecting STDOUT
|
# We're being run by a startup script that isn't redirecting STDOUT
|
||||||
# Redirect it to the log
|
# Redirect it to the log
|
||||||
#
|
#
|
||||||
exec 2> $STARTUP_LOG
|
exec 2>>$STARTUP_LOG
|
||||||
elif [ -z "${SHOREWALL_INIT_SCRIPT}${DEBUG}${tracing}" ]; then
|
|
||||||
#
|
|
||||||
# We're not tracing or debugging -- tee STDOUT to the log
|
|
||||||
#
|
|
||||||
exec 2>| tee -a $STARTUP_LOG
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -27,17 +27,12 @@ fi
|
|||||||
initialize
|
initialize
|
||||||
|
|
||||||
if [ -n "$STARTUP_LOG" ]; then
|
if [ -n "$STARTUP_LOG" ]; then
|
||||||
if [ -a ${SHOREWALL_INIT_SCRIPT:-0} -eq 1 ]; then
|
if [ ${SHOREWALL_INIT_SCRIPT:-0} -eq 1 ]; then
|
||||||
#
|
#
|
||||||
# We're being run by a startup script that isn't redirecting STDOUT
|
# We're being run by a startup script that isn't redirecting STDOUT
|
||||||
# Redirect it to the log
|
# Redirect it to the log
|
||||||
#
|
#
|
||||||
exec 2> $STARTUP_LOG
|
exec 2>>$STARTUP_LOG
|
||||||
elif [ -z "${SHOREWALL_INIT_SCRIPT}${DEBUG}${tracing}" ]; then
|
|
||||||
#
|
|
||||||
# We're not tracing or debugging -- tee STDOUT to the log
|
|
||||||
#
|
|
||||||
exec 2>| tee -a $STARTUP_LOG
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ fi
|
|||||||
|
|
||||||
DAEMON_NAME="shorewall" # of course shorewall is NOT a deamon.
|
DAEMON_NAME="shorewall" # of course shorewall is NOT a deamon.
|
||||||
|
|
||||||
|
export SHOREWALL_INIT_SCRIPT=1
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
stat_busy "Starting $DAEMON_NAME"
|
stat_busy "Starting $DAEMON_NAME"
|
||||||
|
@ -19,10 +19,6 @@ WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup
|
|||||||
# use Shorewall's STARTUP_LOG feature.
|
# use Shorewall's STARTUP_LOG feature.
|
||||||
INITLOG=/var/log/shorewall-init.log
|
INITLOG=/var/log/shorewall-init.log
|
||||||
|
|
||||||
[ "$INITLOG" eq "/dev/null" && SHOREWALL_INIT_SCRIPT=1 || SHOREWALL_INIT_SCRIPT=0
|
|
||||||
|
|
||||||
export SHOREWALL_INIT_SCRIPT
|
|
||||||
|
|
||||||
test -x $SRWL || exit 0
|
test -x $SRWL || exit 0
|
||||||
test -x $WAIT_FOR_IFUP || exit 0
|
test -x $WAIT_FOR_IFUP || exit 0
|
||||||
test -n $INITLOG || {
|
test -n $INITLOG || {
|
||||||
@ -72,6 +68,10 @@ else
|
|||||||
not_configured
|
not_configured
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ "$INITLOG" eq "/dev/null" && SHOREWALL_INIT_SCRIPT=1 || SHOREWALL_INIT_SCRIPT=0
|
||||||
|
|
||||||
|
export SHOREWALL_INIT_SCRIPT
|
||||||
|
|
||||||
# wait for an unconfigured interface
|
# wait for an unconfigured interface
|
||||||
wait_for_pppd () {
|
wait_for_pppd () {
|
||||||
if [ "$wait_interface" != "" ]
|
if [ "$wait_interface" != "" ]
|
||||||
|
@ -17,6 +17,8 @@ fi
|
|||||||
|
|
||||||
DAEMON_NAME="shorewall6" # of course shorewall6 is NOT a deamon.
|
DAEMON_NAME="shorewall6" # of course shorewall6 is NOT a deamon.
|
||||||
|
|
||||||
|
export SHOREWALL_INIT_SCRIPT=1
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
stat_busy "Starting $DAEMON_NAME"
|
stat_busy "Starting $DAEMON_NAME"
|
||||||
|
@ -19,10 +19,6 @@ WAIT_FOR_IFUP=/usr/share/shorewall6/wait4ifup
|
|||||||
# keep logs of the firewall (not recommended)
|
# keep logs of the firewall (not recommended)
|
||||||
INITLOG=/var/log/shorewall6-init.log
|
INITLOG=/var/log/shorewall6-init.log
|
||||||
|
|
||||||
[ "$INITLOG" eq "/dev/null" && SHOREWALL_INIT_SCRIPT=1 || SHOREWALL_INIT_SCRIPT=0
|
|
||||||
|
|
||||||
export SHOREWALL_INIT_SCRIPT
|
|
||||||
|
|
||||||
test -x $SRWL || exit 0
|
test -x $SRWL || exit 0
|
||||||
test -x $WAIT_FOR_IFUP || exit 0
|
test -x $WAIT_FOR_IFUP || exit 0
|
||||||
test -n $INITLOG || {
|
test -n $INITLOG || {
|
||||||
@ -72,6 +68,10 @@ else
|
|||||||
not_configured
|
not_configured
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ "$INITLOG" eq "/dev/null" && SHOREWALL_INIT_SCRIPT=1 || SHOREWALL_INIT_SCRIPT=0
|
||||||
|
|
||||||
|
export SHOREWALL_INIT_SCRIPT
|
||||||
|
|
||||||
# wait for an unconfigured interface
|
# wait for an unconfigured interface
|
||||||
wait_for_pppd () {
|
wait_for_pppd () {
|
||||||
if [ "$wait_interface" != "" ]
|
if [ "$wait_interface" != "" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user