diff options
Diffstat (limited to 'templates/firewall/name/node.def')
-rw-r--r-- | templates/firewall/name/node.def | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/templates/firewall/name/node.def b/templates/firewall/name/node.def index 01dfaf8..ed7c29e 100644 --- a/templates/firewall/name/node.def +++ b/templates/firewall/name/node.def @@ -2,21 +2,14 @@ tag: type: txt -syntax:expression: exec " \ - if [ `echo -n '$VAR(@)' | wc -c` -gt 29 ]; then \ - echo firewall name must be 29 characters or less; \ - exit 1 ; \ - fi ; " - -syntax:expression: pattern $VAR(@) "^[^-]" ; "Firewall rule set name cannot start with \"-\"" - -syntax:expression: pattern $VAR(@) "^[^;]*$" ; "Firewall rule set name cannot contain ';'" - -syntax:expression: exec " - if echo '$VAR(@)' | grep -q '^VZONE'; then - echo Firewall rule set name cannot start with 'VZONE' - exit 1 - fi " +syntax:expression: pattern $VAR(@) "^[[:print:]]{1,29}$" ; \ + "Firewall name must be 29 characters or less" +syntax:expression: pattern $VAR(@) "^[^-]" ; \ + "Firewall rule set name cannot start with \"-\"" +syntax:expression: pattern $VAR(@) "^[^;]*$" ; \ + "Firewall rule set name cannot contain ';'" +syntax:expression: ! pattern $VAR(@) "^VZONE" ; \ + "Firewall rule set name cannot start with 'VZONE'" end: if sudo /opt/vyatta/sbin/vyatta-firewall.pl --update-rules name "$VAR(@)" ; then |