Skip to content

Commit

Permalink
fix_vlan.sh: Refactor script to allow dynamic EntityID instead of har…
Browse files Browse the repository at this point in the history
…d-coded 4354/4363
  • Loading branch information
rtsp committed Nov 17, 2022
1 parent 7020097 commit 7e1c72e
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions Tools/etc/scripts/fix_vlan_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@
set -e

while true; do
omcicli mib get 84 > /tmp/84.tmp

size=$(ls -la /tmp/ | grep 84.tmp | awk '{ print $5 }')
for _EntityID in $(omcicli mib get 84 | grep '^EntityID:' | awk '{print $2}'); do

if [[ "$size" -lt "88" ]]; then
# Looks like the table is not populated yet
sleep 30
continue
fi
_FwdOp=$(omcicli mib get 84 ${_EntityID} | grep '^FwdOp:' | awk '{print $2}')

one_mode=$(awk '/0x1102/{nr[NR]; nr[NR+2]}; NR in nr' /tmp/84.tmp | grep FwdOp | awk '{ print $2 }')
two_mode=$(awk '/0x110b/{nr[NR]; nr[NR+2]}; NR in nr' /tmp/84.tmp | grep FwdOp | awk '{ print $2 }')
if [[ ! -z ${_FwdOp} && ${_FwdOp} != '0x02' ]]; then
omcicli mib set 84 ${_EntityID} FwdOp 0x02
fi

rm /tmp/84.tmp
done

[[ $one_mode != "0x02" ]] && omcicli mib set 84 4354 FwdOp 0x02
[[ $two_mode != "0x02" ]] && omcicli mib set 84 4363 FwdOp 0x02
sleep 30
done;
sleep 30
done

2 comments on commit 7e1c72e

@skon77
Copy link

@skon77 skon77 commented on 7e1c72e Nov 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I update this script integrated in firmware 220817?
When I try to edit via telnet I get a warning that file is read-only.

And is there any information on firmware 220923? Is such a script required there as well?

@rtsp
Copy link
Contributor Author

@rtsp rtsp commented on 7e1c72e Nov 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I update this script integrated in firmware 220817? When I try to edit via telnet I get a warning that file is read-only.

As /etc is in the read-only partition, you need to modify firmware and reflash it.

And is there any information on firmware 220923? Is such a script required there as well?

Sure! Firmware 220923 also require this script. It's related to your OLT configuration, not from firmware itself.

This script was running on my stick that using M110_sfp_ODI_220923.tar but I also add /etc/init.d/rc35 and /etc/scripts/fix_vlan.sh as it doesn't exist on 220923 firmware.

Please sign in to comment.