summaryrefslogtreecommitdiff
path: root/templates/interfaces/tunnel
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/tunnel')
-rw-r--r--templates/interfaces/tunnel/node.tag/key/node.def5
1 files changed, 5 insertions, 0 deletions
diff --git a/templates/interfaces/tunnel/node.tag/key/node.def b/templates/interfaces/tunnel/node.tag/key/node.def
index ae244529..1ece7642 100644
--- a/templates/interfaces/tunnel/node.tag/key/node.def
+++ b/templates/interfaces/tunnel/node.tag/key/node.def
@@ -2,6 +2,11 @@ type: u32
help: Set the tunnel key
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 999999; \
"Must be between 0-999999 for $VAR(../@)"
+syntax:expression: exec " \
+ if [ -n \"`sudo ip tunnel show $VAR(../@) | grep $VAR(../@) `\" ]; then \
+ echo Key can only be set at tunnel creation for $VAR(../@); \
+ exit 1 ; \
+ fi ; "
commit:expression: $VAR(../encapsulation/@) in "gre" ; \
"Key only valid for GRE for $VAR(../@)"