mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-19 17:28:35 +02:00
Hack for broken 'printf' in some lightweight shells
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4814 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
3a4f17e70a
commit
aafbe86404
@ -1203,6 +1203,7 @@ do_log_rule_limit() # $1 = log level, $2 = chain, $3 = display Chain $4 = dispos
|
|||||||
local command=${7:--A}
|
local command=${7:--A}
|
||||||
local prefix
|
local prefix
|
||||||
local base=$(chain_base $displayChain)
|
local base=$(chain_base $displayChain)
|
||||||
|
local pf
|
||||||
|
|
||||||
limit="${5:-$LOGLIMIT}" # Do this here rather than in the declaration above to appease /bin/ash.
|
limit="${5:-$LOGLIMIT}" # Do this here rather than in the declaration above to appease /bin/ash.
|
||||||
|
|
||||||
@ -1214,11 +1215,16 @@ do_log_rule_limit() # $1 = log level, $2 = chain, $3 = display Chain $4 = dispos
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$LOGRULENUMBERS" ]; then
|
if [ -n "$LOGRULENUMBERS" ]; then
|
||||||
|
#
|
||||||
|
# Hack for broken printf on some lightweight shells
|
||||||
|
#
|
||||||
|
[ $(printf "%d" 1) = "1" ] && pf=printf || pf=$(mywhich printf)
|
||||||
|
|
||||||
eval rulenum=\$${base}_logrules
|
eval rulenum=\$${base}_logrules
|
||||||
|
|
||||||
rulenum=${rulenum:-1}
|
rulenum=${rulenum:-1}
|
||||||
|
|
||||||
prefix="$(printf "$LOGFORMAT" $displayChain $rulenum $disposition)${tag}"
|
prefix="$($pf "$LOGFORMAT" $displayChain $rulenum $disposition)${tag}"
|
||||||
|
|
||||||
rulenum=$(($rulenum + 1))
|
rulenum=$(($rulenum + 1))
|
||||||
eval ${base}_logrules=$rulenum
|
eval ${base}_logrules=$rulenum
|
||||||
|
Loading…
x
Reference in New Issue
Block a user