From 62b07a426534c9579d409e3fcd51847eb4e3c670 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 7 Nov 2007 15:29:58 -0800 Subject: invalid op-mode command results in error message --- etc/bash_completion.d/10vyatta-op | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index cf40e59..9da12aa 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -207,11 +207,20 @@ _vyatta_op_run () tpath+=/node.tag else echo "Invalid command" >&2 + eval $restore_shopts return 1 fi done - eval "$(_vyatta_op_get_node_def_field $tpath/node.def run)" + local run_cmd=$(_vyatta_op_get_node_def_field $tpath/node.def run) + local ret=0 + if [ -n "$run_cmd" ]; then + eval "$run_cmd" + else + echo "Invalid command" >&2 + ret=1 + fi eval $restore_shopts + return $ret } # don't initialize if we are in configure mode -- cgit v1.2.3