summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@vyatta.com>2008-03-21 15:37:50 -0700
committerTom Grennan <tgrennan@vyatta.com>2008-03-21 15:37:50 -0700
commitbab90d98dd63412cd52d6bcaf000cd9055f05d93 (patch)
tree21fbd10e8ce81b3139f44ef0ad2107cda1e02ac2 /etc/bash_completion.d
parentae08c7412f3617e5873430064b7010f2a38993dd (diff)
downloadvyatta-op-bab90d98dd63412cd52d6bcaf000cd9055f05d93.tar.gz
vyatta-op-bab90d98dd63412cd52d6bcaf000cd9055f05d93.zip
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
Diffstat (limited to 'etc/bash_completion.d')
-rw-r--r--etc/bash_completion.d/10vyatta-op19
1 files changed, 9 insertions, 10 deletions
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