From 54e776a0c09e41cbd867a69093845f1f45deaba1 Mon Sep 17 00:00:00 2001
From: Mohit Mehta <mohit.mehta@vyatta.com>
Date: Fri, 2 Oct 2009 18:26:40 -0700
Subject: use pattern instead of exec

---
 templates/zone-policy/zone/node.def | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

(limited to 'templates/zone-policy/zone/node.def')

diff --git a/templates/zone-policy/zone/node.def b/templates/zone-policy/zone/node.def
index 80e4f4e2..a27f90a9 100644
--- a/templates/zone-policy/zone/node.def
+++ b/templates/zone-policy/zone/node.def
@@ -2,11 +2,8 @@ tag:
 type: txt
 help: Set zone name
 
-syntax:expression: exec "                                    \
-        if [ `echo -n '$VAR(@)' | wc -c` -gt 20 ]; then    \
-          echo  Zone name must be 20 characters or less; \
-          exit 1 ;                                           \
-        fi ; "
+syntax:expression: pattern $VAR(@) "^[[:print:]]{1,20}$" ;
+                "Zone name must be 20 characters or less"
 
 syntax:expression: pattern $VAR(@) "^[^-]" ; "Zone name cannot start with \"-\""
 
-- 
cgit v1.2.3

