mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 07:33:43 +01:00
Merge branch '5.2.0'
This commit is contained in:
commit
b6d1293b2e
@ -1201,11 +1201,17 @@ show_saves_command() {
|
||||
echo
|
||||
|
||||
for f in ${VARDIR}/*-iptables; do
|
||||
case $f in
|
||||
*\**)
|
||||
;;
|
||||
*)
|
||||
fn=$(basename $f)
|
||||
fn=${fn%-iptables}
|
||||
mtime=$(ls -lt $f | tail -n 1 | cut -d ' ' -f '6 7 8' )
|
||||
[ $fn = "$RESTOREFILE" ] && fn="$fn (default)"
|
||||
echo " $mtime ${fn%-iptables}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo
|
||||
|
9
Shorewall/Macros/macro.IPFS-swarm
Normal file
9
Shorewall/Macros/macro.IPFS-swarm
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# Shorewall -- /usr/share/shorewall/macro.IPFS-swarm
|
||||
#
|
||||
# This macro handles IPFS data traffic (the connection to IPFS swarm).
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||
|
||||
PARAM - - tcp 4001
|
@ -2529,6 +2529,10 @@ sub split_rawline2( $$;$$$ ) {
|
||||
# Delete trailing comment
|
||||
#
|
||||
$currentline =~ s/\s*#.*//;
|
||||
#
|
||||
# Convert ${...} to $...
|
||||
#
|
||||
$currentline =~ s/\$\{(.*?)\}/\$$1/g;
|
||||
|
||||
my @result = &split_line2( @_ );
|
||||
|
||||
@ -5459,7 +5463,7 @@ sub update_config_file( $ ) {
|
||||
update_default( 'BLACKLIST_DEFAULT', 'AllowICMPs,dropBcasts,dropNotSyn,dropInvalid' );
|
||||
}
|
||||
|
||||
for ( qw/DROP_DEFAULT REJECT_DEFAULT/ ) {
|
||||
for ( qw/DROP_DEFAULT REJECT_DEFAULT BLACKLIST_DEFAULT/ ) {
|
||||
my $policy = $config{ $_ };
|
||||
|
||||
if ( $policy =~ /\bA_(?:Drop|Reject)\b/ ) {
|
||||
@ -6599,7 +6603,7 @@ sub get_configuration( $$$ ) {
|
||||
default_yes_no 'BALANCE_PROVIDERS' , $config{USE_DEFAULT_RT} ? 'Yes' : '';
|
||||
default_yes_no 'USE_NFLOG_SIZE' , '';
|
||||
|
||||
if ( ( $val = $config{AUTOMAKE} ) !~ /^[Rr]ecursive$/ ) {
|
||||
if ( ( $val = ( $config{AUTOMAKE} || '' ) ) !~ /^[Rr]ecursive$/ ) {
|
||||
default_yes_no( 'AUTOMAKE' , '' ) unless $val && $val =~ /^\d{1,2}$/;
|
||||
}
|
||||
|
||||
|
@ -810,7 +810,7 @@ sub add_common_rules ( $ ) {
|
||||
$dbl_dst_target = $dbl_src_target;
|
||||
}
|
||||
} elsif ( $dbl_level ) {
|
||||
my $chainref = set_optflags( new_standard_chain( $dbl_src_target = 'dbl_log' ) , DONT_OPTIMIZE | DONT_DELETE );
|
||||
my $chainref = set_optflags( new_standard_chain( $dbl_src_target = $dbl_dst_target = 'dbl_log' ) , DONT_OPTIMIZE | DONT_DELETE );
|
||||
|
||||
log_rule_limit( $dbl_level,
|
||||
$chainref,
|
||||
|
@ -675,7 +675,7 @@ interface_is_usable() # $1 = interface
|
||||
status=0
|
||||
|
||||
if ! loopback_interface $1; then
|
||||
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 ]; then
|
||||
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 ] && [ -z "$($IP -$g_family link list dev $1 2> /dev/null | fgrep 'state DOWN')" ]; then
|
||||
if [ "$COMMAND" != enable ]; then
|
||||
[ ! -f ${VARDIR}/${1}_disabled ] && run_isusable_exit $1
|
||||
status=$?
|
||||
@ -1101,7 +1101,7 @@ interface_is_usable() # $1 = interface
|
||||
status=0
|
||||
|
||||
if [ "$1" != lo ]; then
|
||||
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ]; then
|
||||
if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ] && [ -z "$($IP -$g_family link list dev $1 2> /dev/null | fgrep 'state DOWN')" ]; then
|
||||
if [ "$COMMAND" != enable ]; then
|
||||
[ ! -f ${VARDIR}/${1}_disabled ] && run_isusable_exit $1
|
||||
status=$?
|
||||
|
@ -412,10 +412,14 @@ uptodate() {
|
||||
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
elif [ $AUTOMAKE = recursive ]; then
|
||||
elif [ "$AUTOMAKE" = recursive ]; then
|
||||
if [ -n "$(${find} ${dir} -newer $1 -print -quit)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
elif [ -z "$AUTOMAKE" ]; then
|
||||
if [ -n "$(${find} ${dir} -maxdepth 1 -type f -newer $1 -print -quit)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print -quit)" ]; then
|
||||
return 1;
|
||||
fi
|
||||
@ -1063,6 +1067,41 @@ restart_command() {
|
||||
return $rc
|
||||
}
|
||||
|
||||
read_yesno_with_timeout() {
|
||||
local timeout
|
||||
timeout=${1:-60}
|
||||
|
||||
case $timeout in
|
||||
*s)
|
||||
;;
|
||||
*m)
|
||||
timeout=$((${timeout%m} * 60))
|
||||
;;
|
||||
*h)
|
||||
timeout=$((${timeout%h} * 3600))
|
||||
;;
|
||||
esac
|
||||
|
||||
read -t $timeout yn 2> /dev/null
|
||||
if [ $? -eq 2 ]
|
||||
then
|
||||
# read doesn't support timeout
|
||||
test -x /bin/bash || return 2 # bash is not installed so the feature is not available
|
||||
/bin/bash -c "read -t $timeout yn ; if [ \"\$yn\" == \"y\" ] ; then exit 0 ; else exit 1 ; fi" # invoke bash and use its version of read
|
||||
return $?
|
||||
else
|
||||
# read supports timeout
|
||||
case "$yn" in
|
||||
y|Y)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Safe-start/safe-reload/safe-restart Command Executor
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user