forked from extern/shorewall_code
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
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
|
@@ -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