summaryrefslogtreecommitdiff
path: root/templates/system/static-host-mapping/host-name/node.def
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@io.vyatta.com>2007-12-13 18:36:03 -0800
committerTom Grennan <tgrennan@io.vyatta.com>2007-12-13 18:36:03 -0800
commit6ea2c7979320d032c2213d271309d6026d57775b (patch)
tree003bec6fbbc6cf54598bc8a5dda5e1efea4c702c /templates/system/static-host-mapping/host-name/node.def
parente6ed55f7593a0f4bc2700bc7b90903bb012e27f6 (diff)
parent7f5f7bedf4f47a42fcb7e32538ccf2d78c75234b (diff)
downloadvyatta-cfg-quagga-6ea2c7979320d032c2213d271309d6026d57775b.tar.gz
vyatta-cfg-quagga-6ea2c7979320d032c2213d271309d6026d57775b.zip
Merge branch 'master' of http://phuket.vyatta.com/vyatta-cfg-system
Diffstat (limited to 'templates/system/static-host-mapping/host-name/node.def')
-rw-r--r--templates/system/static-host-mapping/host-name/node.def7
1 files changed, 7 insertions, 0 deletions
diff --git a/templates/system/static-host-mapping/host-name/node.def b/templates/system/static-host-mapping/host-name/node.def
index ea0000af..275aa867 100644
--- a/templates/system/static-host-mapping/host-name/node.def
+++ b/templates/system/static-host-mapping/host-name/node.def
@@ -2,3 +2,10 @@ 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 \"\
+ 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\" "