From aae474df5f2b1ef2563e5f8450f658fe96c54ad1 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Fri, 18 Apr 2008 00:21:20 +0000 Subject: Fix Bug 3172 set interfaces tunnel <> key <> allowed after tunnel creation -key not allowed to be set after tunnel creation --- templates/interfaces/tunnel/node.tag/key/node.def | 5 +++++ 1 file changed, 5 insertions(+) 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(../@)" -- cgit v1.2.3