mirror of
https://github.com/firehol/firehol.git
synced 2024-06-28 18:02:33 +00:00
properly call sleep
This commit is contained in:
parent
b94bf08508
commit
d5d001b6f9
14
sbin/firehol
14
sbin/firehol
@ -1378,24 +1378,24 @@ ${MKDIR_CMD} "${FIREHOL_DIR}/fast/table6s" || exit 1
|
||||
# this is needed only when we are going to save the firewall
|
||||
# with iptables-save.
|
||||
file open 20 "${FIREHOL_DIR}/firewall_restore_commands.sh" w || exit 1
|
||||
$CAT_CMD >&20 <<'EOFMTL'
|
||||
$CAT_CMD >&20 <<EOFMTL
|
||||
#!/bin/sh
|
||||
# Generated by FireHOL to execute additional actions
|
||||
# to restore the generated firewall.
|
||||
#
|
||||
|
||||
# a function to help us save a value to a file
|
||||
postprocess_echo_to() { echo "${1}" >"${2}"; }
|
||||
postprocess_echo_to() { echo "\${1}" >"\${2}"; }
|
||||
postprocess_wait_netfilter() {
|
||||
maxwait=60
|
||||
waiting=0
|
||||
while [ ! -f /proc/sys/net/netfilter/nf_conntrack_max -a ${waiting} -le ${maxwait} ]
|
||||
while [ ! -f /proc/sys/net/netfilter/nf_conntrack_max -a \${waiting} -le \${maxwait} ]
|
||||
do
|
||||
echo >&2 "netfilter is not ready; waiting ${waiting} of ${maxwait}"
|
||||
sleep 1
|
||||
waiting=$(( waiting + 1 ))
|
||||
echo >&2 "netfilter is not ready; waiting \${waiting} of \${maxwait}"
|
||||
${SLEEP_CMD} 1
|
||||
waiting=\$(( waiting + 1 ))
|
||||
done
|
||||
[ ${waiting} -gt ${maxwait} ] && return 1
|
||||
[ \${waiting} -gt \${maxwait} ] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user