diff options
author | sever-sever <v.gletenko@vyos.io> | 2020-10-26 13:10:27 +0000 |
---|---|---|
committer | sever-sever <v.gletenko@vyos.io> | 2020-10-26 13:10:27 +0000 |
commit | 2bbf09fed8ce6af4f2e2bff60a2d1915a41cf481 (patch) | |
tree | 2e13c275cf8773614155eab982601daba7ed156d | |
parent | ad1c2f3bd7e47b19763e8bce1143614b906d3b5d (diff) | |
download | vyos-1x-2bbf09fed8ce6af4f2e2bff60a2d1915a41cf481.tar.gz vyos-1x-2bbf09fed8ce6af4f2e2bff60a2d1915a41cf481.zip |
bfd: T2982: Fixed show command for BFD peers
-rw-r--r-- | op-mode-definitions/show-protocols-bfd.xml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/op-mode-definitions/show-protocols-bfd.xml b/op-mode-definitions/show-protocols-bfd.xml index 398a81d1b..4b8abd99d 100644 --- a/op-mode-definitions/show-protocols-bfd.xml +++ b/op-mode-definitions/show-protocols-bfd.xml @@ -27,13 +27,13 @@ <script>/usr/bin/vtysh -c "show bfd peers" | awk '/[:blank:]*peer/ { printf "%s\n", $2 }'</script> </completionHelp> </properties> - <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 '($0 ~ peer BFD_PEER) { system("/usr/bin/vtysh -c \"show bfd " $0 "\"") }'</command> + <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("/usr/bin/vtysh -c \"show bfd " peer "\"") }'</command> <children> <leafNode name="counters"> <properties> <help>Show Bidirectional Forwarding Detection (BFD) peer counters</help> </properties> - <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 '($0 ~ peer BFD_PEER) { system("/usr/bin/vtysh -c \"show bfd " $0 " counters\"") }'</command> + <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("/usr/bin/vtysh -c \"show bfd " peer " counters\"") }'</command> </leafNode> </children> </tagNode> |