diff options
Diffstat (limited to 'templates/firewall/ipv6-name/node.def')
-rw-r--r-- | templates/firewall/ipv6-name/node.def | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/templates/firewall/ipv6-name/node.def b/templates/firewall/ipv6-name/node.def index 0d3fb79..c794dc3 100644 --- a/templates/firewall/ipv6-name/node.def +++ b/templates/firewall/ipv6-name/node.def @@ -2,21 +2,14 @@ tag: type: txt -syntax:expression: exec " \ - if [ `echo -n '$VAR(@)' | wc -c` -gt 29 ]; then \ - echo firewall ipv6-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 ipv6-name "$VAR(@)" ; then |