forked from extern/shorewall_code
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c02b71b530 | ||
|
78269d57bc | ||
|
fc91648315 | ||
|
067f435ac5 | ||
|
2039f38faf | ||
|
07654d8f8d | ||
|
b5e8f9bd50 | ||
|
9c950082f6 |
@@ -1201,11 +1201,17 @@ show_saves_command() {
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
for f in ${VARDIR}/*-iptables; do
|
for f in ${VARDIR}/*-iptables; do
|
||||||
fn=$(basename $f)
|
case $f in
|
||||||
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}"
|
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
|
done
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
9
Shorewall/Macros/macro.IPFS-API
Normal file
9
Shorewall/Macros/macro.IPFS-API
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# Shorewall -- /usr/share/shorewall/macro.IPFS-API
|
||||||
|
#
|
||||||
|
# This macro handles IPFS API port (commands for the IPFS daemon).
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||||
|
|
||||||
|
PARAM - - tcp 5001
|
9
Shorewall/Macros/macro.IPFS-gateway
Normal file
9
Shorewall/Macros/macro.IPFS-gateway
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# Shorewall -- /usr/share/shorewall/macro.IPFS-gateway
|
||||||
|
#
|
||||||
|
# This macro handles the IPFS gateway to HTTP.
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||||
|
|
||||||
|
PARAM - - tcp 8080
|
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
|
# Delete trailing comment
|
||||||
#
|
#
|
||||||
$currentline =~ s/\s*#.*//;
|
$currentline =~ s/\s*#.*//;
|
||||||
|
#
|
||||||
|
# Convert ${...} to $...
|
||||||
|
#
|
||||||
|
$currentline =~ s/\$\{(.*?)\}/\$$1/g;
|
||||||
|
|
||||||
my @result = &split_line2( @_ );
|
my @result = &split_line2( @_ );
|
||||||
|
|
||||||
@@ -5459,7 +5463,7 @@ sub update_config_file( $ ) {
|
|||||||
update_default( 'BLACKLIST_DEFAULT', 'AllowICMPs,dropBcasts,dropNotSyn,dropInvalid' );
|
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{ $_ };
|
my $policy = $config{ $_ };
|
||||||
|
|
||||||
if ( $policy =~ /\bA_(?:Drop|Reject)\b/ ) {
|
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 'BALANCE_PROVIDERS' , $config{USE_DEFAULT_RT} ? 'Yes' : '';
|
||||||
default_yes_no 'USE_NFLOG_SIZE' , '';
|
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}$/;
|
default_yes_no( 'AUTOMAKE' , '' ) unless $val && $val =~ /^\d{1,2}$/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -192,7 +192,7 @@ find_default_interface() {
|
|||||||
# Determine if Interface is up
|
# Determine if Interface is up
|
||||||
#
|
#
|
||||||
interface_is_up() {
|
interface_is_up() {
|
||||||
[ -n "$($IP -$g_family link list dev $1 2> /dev/null | grep -e '[<,]UP[,>]')" ]
|
[ -n "$($IP -$g_family link list dev $1 2> /dev/null | grep -e '[<,]UP[,>]' | grep -v ' state DOWN ')" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -412,10 +412,14 @@ uptodate() {
|
|||||||
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print)" ]; then
|
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print)" ]; then
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
elif [ $AUTOMAKE = recursive ]; then
|
elif [ "$AUTOMAKE" = recursive ]; then
|
||||||
if [ -n "$(${find} ${dir} -newer $1 -print -quit)" ]; then
|
if [ -n "$(${find} ${dir} -newer $1 -print -quit)" ]; then
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
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
|
elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print -quit)" ]; then
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
@@ -1063,6 +1067,41 @@ restart_command() {
|
|||||||
return $rc
|
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
|
# Safe-start/safe-reload/safe-restart Command Executor
|
||||||
#
|
#
|
||||||
|
Reference in New Issue
Block a user