summaryrefslogtreecommitdiff
path: root/src/completion
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-05 10:39:32 +0200
committerChristian Poessinger <christian@poessinger.com>2022-07-05 12:21:45 +0200
commitda961052291515f2e31bb4eca4d9091fad8c4d3c (patch)
tree3f6968bdbf434e3d02d001cee9ef15d731475fcf /src/completion
parent4d405cc696b777c3ed96f2d22c7c82ca40c39a88 (diff)
downloadvyos-1x-da961052291515f2e31bb4eca4d9091fad8c4d3c.tar.gz
vyos-1x-da961052291515f2e31bb4eca4d9091fad8c4d3c.zip
op-mode: bgp: T4494: add "reset bgp" op-mode tree
Diffstat (limited to 'src/completion')
-rwxr-xr-xsrc/completion/list_bgp_neighbors.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/completion/list_bgp_neighbors.sh b/src/completion/list_bgp_neighbors.sh
index f74f102ef..869a7ab0a 100755
--- a/src/completion/list_bgp_neighbors.sh
+++ b/src/completion/list_bgp_neighbors.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2021 VyOS maintainers and contributors
+# Copyright (C) 2021-2022 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -18,19 +18,21 @@
ipv4=0
ipv6=0
+vrf=""
while [[ "$#" -gt 0 ]]; do
case $1 in
-4|--ipv4) ipv4=1 ;;
-6|--ipv6) ipv6=1 ;;
-b|--both) ipv4=1; ipv6=1 ;;
+ --vrf) vrf="vrf name $2"; shift ;;
*) echo "Unknown parameter passed: $1" ;;
esac
shift
done
declare -a vals
-eval "vals=($(cli-shell-api listActiveNodes protocols bgp neighbor))"
+eval "vals=($(cli-shell-api listActiveNodes $vrf protocols bgp neighbor))"
if [ $ipv4 -eq 1 ] && [ $ipv6 -eq 1 ]; then
echo -n '<x.x.x.x>' '<h:h:h:h:h:h:h:h>' ${vals[@]}
@@ -54,9 +56,10 @@ elif [ $ipv6 -eq 1 ] ; then
done
else
echo "Usage:"
- echo "-4|--ipv4 list only IPv4 peers"
- echo "-6|--ipv6 list only IPv6 peers"
- echo "--both list both IP4 and IPv6 peers"
+ echo "-4|--ipv4 list only IPv4 peers"
+ echo "-6|--ipv6 list only IPv6 peers"
+ echo "--both list both IP4 and IPv6 peers"
+ echo "--vrf <name> apply command to given VRF (optional)"
echo ""
exit 1
fi