mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-27 01:53:27 +01: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 prefix
|
||||
local base=$(chain_base $displayChain)
|
||||
local pf
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
rulenum=${rulenum:-1}
|
||||
|
||||
prefix="$(printf "$LOGFORMAT" $displayChain $rulenum $disposition)${tag}"
|
||||
prefix="$($pf "$LOGFORMAT" $displayChain $rulenum $disposition)${tag}"
|
||||
|
||||
rulenum=$(($rulenum + 1))
|
||||
eval ${base}_logrules=$rulenum
|
||||
|
Loading…
Reference in New Issue
Block a user