summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrividya0208 <68350089+srividya0208@users.noreply.github.com>2021-05-20 00:19:40 +0530
committerGitHub <noreply@github.com>2021-05-19 20:49:40 +0200
commitcc8a03a6711d99c1c877c1abb84e60a271143e65 (patch)
tree45fa63893c4ccad649b4fe79a659d654dac1ff60
parentb0f75452279f16bc301333c801766de037fdbe0d (diff)
downloadvyatta-cfg-quagga-cc8a03a6711d99c1c877c1abb84e60a271143e65.tar.gz
vyatta-cfg-quagga-cc8a03a6711d99c1c877c1abb84e60a271143e65.zip
protocols: static: T3558: add completion helper for dhcp-interface options
The command "set proto static route x.x.x.x/x dhcp-interface" does not show the possible interface list when entered a tab. Added the previous parameters to the script
-rw-r--r--templates/protocols/static/route/node.tag/dhcp-interface/node.def9
1 files changed, 4 insertions, 5 deletions
diff --git a/templates/protocols/static/route/node.tag/dhcp-interface/node.def b/templates/protocols/static/route/node.tag/dhcp-interface/node.def
index 7820800b..e1793c08 100644
--- a/templates/protocols/static/route/node.tag/dhcp-interface/node.def
+++ b/templates/protocols/static/route/node.tag/dhcp-interface/node.def
@@ -1,9 +1,8 @@
type: txt
-help: DHCP interface that supplies the next-hop IP address for this static route
-allowed:
- local -a array ;
- array=( /var/lib/dhcp/en* /var/lib/dhcp/eth* /var/lib/dhcp/br* /var/lib/dhcp/bond* ) ;
- echo -n ${array[@]##*/}
+help: DHCP interface supplying next-hop IP address
+val_help: txt; DHCP interface name
+allowed: sh -c "${vyos_completion_dir}/list_interfaces.py"
+syntax:expression: exec "${vyos_libexec_dir}/validate-value --exec \"${vyos_validators_dir}/interface-name \" --value \'$VAR(@)\'"; "Invalid value"
create:
sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=create
RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)