$'BEGINFILE { x=0; answ=0 }' \
$'{' \
$'if (/.*{$/) { x++ }' \
- $'else if (/.*}$/) { x-- }' \
- $'else if ( x == 2 && $1 ~ "[[:space:]]*"vkey) { value=substr($2, 2); value=substr(value, 1, length(value) - 1); }' \
- $'if ( x == 2 && value == vvalue && $1 ~ /[[:space:]]*init_requests_count/) { answ=$2 }' \
+ $'else if (/.*}$/) { x--; if (x == 1) { finished=-1; found=0 } }' \
+ $'else if ( x == 2 && $1 ~ "[[:space:]]*"vkey) { value=substr($2, 2); value=substr(value, 1, length(value) - 1); if (value == vvalue) found=1 }' \
+ $'else if ( x == 2 && found == 1 && $1 ~ /[[:space:]]*polling_finished/) { finished=$2 }' \
+ $'if ( x == 2 && found == 1 && finished == 0 && $1 ~ /[[:space:]]*init_requests_count/) { answ=$2 }' \
$'if (answ > 0) { exit 0 }' \
$'}' \
$'END { printf "%d", answ }'
lvmpolld_dump > lvmpolld_dump.txt
all=1
for l in "${lvid[@]%-real}" ; do
+ # check_lvmpolld_init_rq_count now ignores finished entries
check_lvmpolld_init_rq_count 1 "${l##LVM-}" lvid || all=0
done
[[ "$all" = 1 ]] && return