diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-10 21:51:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 21:51:36 +0200 |
commit | f812c5d1ce01efa8323bfb797c57f68f474665bb (patch) | |
tree | 3b243e9a8658f71cc8df085450946994966e702e | |
parent | bc5cec0fbb9f8828b4928eb047ffdee38306269c (diff) | |
parent | a5500a771ee33d02efa566a0f36b574a16145787 (diff) | |
download | vyos-1x-f812c5d1ce01efa8323bfb797c57f68f474665bb.tar.gz vyos-1x-f812c5d1ce01efa8323bfb797c57f68f474665bb.zip |
Merge pull request #451 from zdc/T2573
BFD: T2573: 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 2cc8a1297..4483b39bf 100644 --- a/op-mode-definitions/show-protocols-bfd.xml +++ b/op-mode-definitions/show-protocols-bfd.xml @@ -30,13 +30,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> |