Browse Source

collectd: sqm_collect: optimise parent search

There can be only 1 parent process ID, so as soon as we find it, print
it and exit - there's no point searching any of the following lines

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
lilik-openwrt-22.03
Kevin Darbyshire-Bryant 3 years ago
committed by Kevin Darbyshire-Bryant
parent
commit
9db12bbaff
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utils/collectd/files/exec-scripts/sqm_collectd.sh

+ 1
- 1
utils/collectd/files/exec-scripts/sqm_collectd.sh View File

@ -100,7 +100,7 @@ process_qdisc() {
}
# while not orphaned
while [ $(awk '$1 ~ "^PPid:" {print $2}' /proc/$$/status) -ne 1 ] ; do
while [ $(awk '$1 ~ "^PPid:" {print $2;exit}' /proc/$$/status) -ne 1 ] ; do
for ifc in "$@" ; do
process_qdisc "$ifc"
done


Loading…
Cancel
Save