From 2c48c6ff54fb4b0d29dd37a70e7cfa861f39bedb Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 27 Mar 2009 15:48:45 -0700 Subject: Use CLI regex to check length of key Less overhead. --- .../ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'interface-templates/ip/ospf') diff --git a/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def b/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def index 5efd3ef7..5e7a121e 100644 --- a/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def +++ b/interface-templates/ip/ospf/authentication/md5/key-id/node.tag/md5-key/node.def @@ -1,9 +1,6 @@ type: txt help: Set md5 key -syntax:expression: exec " \ - if [ `echo -n '$VAR(@)' | wc -c` -gt 16 ]; then \ - echo MD5 key must be 16 characters or less ; \ - exit 1 ; \ - fi ; " +syntax:expression: pattern "^[^[:space:]]{1,16}" ; \ + "MD5 key must be 16 characters or less" comp_help: possible completions: MD5 Key (16 characters or less) -- cgit v1.2.3