qosmngr: Update BDMF shell usage

This commit is contained in:
Markus Gothe 2023-02-03 04:35:01 +00:00 committed by Rahul Thakur
parent 7a877b0c45
commit 09211031ac

View file

@ -932,21 +932,12 @@ assign_policer_to_port() {
local ifname="$1"
local pindex="$2"
local portorder="$(db -q get hw.board.ethernetPortOrder)"
local wanport="$(db -q get hw.board.ethernetWanPort)"
local runner_lan_ports="$(bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/examine port | grep ': port/index=lan' | sed -e 's#\.##g' | cut -f2 -d' ' | sort -u | xargs)"
local i=1
for port in $portorder; do
if [ "$ifname" == "$port" ]; then
if [ "$wanport" == "$port" ]; then
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
else
local lanport="$(echo -n "$runner_lan_ports" | cut -f${i} -d' ')"
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure $lanport ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
fi
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/name=$port ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
break
fi
i=$((i+1))
done
}