From bab90d98dd63412cd52d6bcaf000cd9055f05d93 Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Fri, 21 Mar 2008 15:37:50 -0700 Subject: record selected vtysh (vyatta-quagga vs quagga) in exported shell variable available to templates; for example: /opt/vyatta/share/vyatta-op/templates/show/ip/route/node.def help: Show IP routes run: LESSOPEN="|{_vyatta_vtysh} -c \"$*\"" less ${_vyatta_less_options} \ --prompt=".ip routes"\ -- ip-route --- etc/bash_completion.d/10vyatta-op | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'etc') diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index 24082e8..8ccb7ee 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -424,16 +424,15 @@ _vyatta_pipe_completion () return 0 } -vtysh () -{ - if [ -S /var/run/vyatta/quagga/zebra.vty ] ; then - vyatta-vtysh "$@" - elif [ ! -S /var/run/quagga/zebra.vty ] ; then - /usr/bin/vtysh "$@" - else - echo "Can't connect with zebra daemon" - fi -} +if [ -S /var/run/vyatta/quagga/zebra.vty ] ; then + declare -x -r _vyatta_vtysh=vyatta-vtysh +elif [ ! -S /var/run/quagga/zebra.vty ] ; then + declare -x -r _vyatta_vtysh=/usr/bin/vtysh +else + declare -x -r _vyatta_vtysh="echo \"Can't connect with zebra daemon to run: vtysh \"" +fi + +alias vtysh=$_vyatta_vtysh # don't initialize if we are in configure mode if [ "$_OFR_CONFIGURE" == "ok" ]; then -- cgit v1.2.3