summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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