summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/bash_completion.d/10vyatta-op12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op
index 7019681..3d144a6 100644
--- a/etc/bash_completion.d/10vyatta-op
+++ b/etc/bash_completion.d/10vyatta-op
@@ -411,8 +411,16 @@ unset nullglob_save
_vyatta_op_init $@
-type vyatta-vtysh &>/dev/null && \
- alias vtysh=vyatta-vtysh
+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
+}
### Local Variables:
### mode: shell-script