diff options
Diffstat (limited to 'templates/system/static-host-mapping/host-name/node.def')
-rw-r--r-- | templates/system/static-host-mapping/host-name/node.def | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/system/static-host-mapping/host-name/node.def b/templates/system/static-host-mapping/host-name/node.def index 275aa867..99f66fb7 100644 --- a/templates/system/static-host-mapping/host-name/node.def +++ b/templates/system/static-host-mapping/host-name/node.def @@ -1,11 +1,11 @@ tag: type: txt -help: "Map DNS names to system interfaces" -syntax: pattern $(@) "^[-a-zA-Z0-9.]+$" ; "invalid host name $(@)" -commit: $(./inet) != ""; "IP address for the static mapping must be set" -end: "sudo sh -c \"\ +help: Map DNS names to system interfaces +syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]+$" ; "invalid host name $VAR(@)" +commit:expression: $VAR(./inet) != ""; "IP address for the static mapping must be set" +end:expression: "sudo sh -c \"\ touch /etc/hosts; \ - sed -i '/ $(@) .*#vyatta entry/d' /etc/hosts; \ - if [ -z \"$(./inet/@)\" ]; then exit 0; fi; \ - declare -a aliases=( $(alias/@@) ); \ - echo \\\"$(inet/@)\t $(@) \\\\\${aliases[*]} \t #vyatta entry\\\" \ >> /etc/hosts\" " + sed -i '/ $VAR(@) .*#vyatta entry/d' /etc/hosts; \ + if [ -z \"$VAR(./inet/@)\" ]; then exit 0; fi; \ + declare -a aliases=( $VAR(alias/@@) ); \ + echo \\\"$VAR(inet/@)\t $VAR(@) \\${aliases[*]} \t #vyatta entry\\\" \ >> /etc/hosts\" " |