summaryrefslogtreecommitdiff
path: root/templates/firewall
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2009-10-02 18:17:55 -0700
committerStig Thormodsrud <stig@vyatta.com>2009-10-02 18:17:55 -0700
commiteead90d563cc74caf577975ce6e84b27f5d83f08 (patch)
tree05ee617e08c310fc770c90e3e6257eeda449bc4c /templates/firewall
parentbf06ade19bd6a6945c0a8f2ae12c1114c7cd1b18 (diff)
downloadvyatta-cfg-firewall-eead90d563cc74caf577975ce6e84b27f5d83f08.tar.gz
vyatta-cfg-firewall-eead90d563cc74caf577975ce6e84b27f5d83f08.zip
Change syntax exec to syntax pattern.
Diffstat (limited to 'templates/firewall')
-rw-r--r--templates/firewall/ipv6-modify/node.def23
-rw-r--r--templates/firewall/ipv6-name/node.def23
-rw-r--r--templates/firewall/modify/node.def23
-rw-r--r--templates/firewall/name/node.def23
4 files changed, 32 insertions, 60 deletions
diff --git a/templates/firewall/ipv6-modify/node.def b/templates/firewall/ipv6-modify/node.def
index 5ad9f1f..b544a1e 100644
--- a/templates/firewall/ipv6-modify/node.def
+++ b/templates/firewall/ipv6-modify/node.def
@@ -2,21 +2,14 @@ tag:
type: txt
-syntax:expression: exec " \
- if [ `echo -n '$VAR(@)' | wc -c` -gt 29 ]; then \
- echo firewall ipv6-modify 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-modify "$VAR(@)" ;
then
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
diff --git a/templates/firewall/modify/node.def b/templates/firewall/modify/node.def
index ec5955a..79767b3 100644
--- a/templates/firewall/modify/node.def
+++ b/templates/firewall/modify/node.def
@@ -2,21 +2,14 @@ tag:
type: txt
-syntax:expression: exec " \
- if [ `echo -n '$VAR(@)' | wc -c` -gt 29 ]; then \
- echo firewall modify must be 29 characters or less; \
- exit 1 ; \
- fi ; "
-
-syntax:expression: pattern $VAR(@) "^[^-]" ; "Modify 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 modify "$VAR(@)" ;
then
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