diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-09-25 15:55:26 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-09-25 15:55:26 -0700 |
commit | e9a79a249cec69fc178098d2f75db9389068510a (patch) | |
tree | 0e366094b7fecd3988c243fbbb574015e0c900c8 /templates/system/static-host-mapping | |
download | vyatta-cfg-upstream.tar.gz vyatta-cfg-upstream.zip |
initial import (from eureka /cli) plus new build system.upstream
Diffstat (limited to 'templates/system/static-host-mapping')
4 files changed, 68 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 new file mode 100644 index 0000000..ea0000a --- /dev/null +++ b/templates/system/static-host-mapping/host-name/node.def @@ -0,0 +1,4 @@ +tag: +type: txt +help: "Map DNS names to system interfaces" +syntax: pattern $(@) "^[-a-zA-Z0-9.]+$" ; "invalid host name $(@)" diff --git a/templates/system/static-host-mapping/host-name/node.tag/alias/node.def b/templates/system/static-host-mapping/host-name/node.tag/alias/node.def new file mode 100644 index 0000000..b6f897f --- /dev/null +++ b/templates/system/static-host-mapping/host-name/node.tag/alias/node.def @@ -0,0 +1,33 @@ +multi: +type: txt +help: "Alias for this address" +create: "sh -c \"touch /etc/hosts && \ +sed -i '/$(../@).*#vyatta entry/d;/127\\.0\\.0\\.1.*#vyatta entry/d' \ +/etc/hosts && \ +echo \\\"$(../inet/@)\t $(../@) $(@) \t #vyatta entry\\\" \ +>> /etc/hosts && \ +if [ x$(../../../domain-name/@) == x ]; \ +then \ +echo \\\"127.0.0.1\t localhost $(../../../host-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +else \ +echo \\\"127.0.0.1\t localhost \ +$(../../../host-name/@).$(../../../domain-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +fi\" " +update: "sh -c \"touch /etc/hosts && \ +sed -i '/$(../@).*#vyatta entry/d;/127\\.0\\.0\\.1.*#vyatta entry/d' \ +/etc/hosts && \ +echo \\\"$(../inet/@)\t $(../@) $(@) \t #vyatta entry\\\" \ +>> /etc/hosts && \ +if [ x$(../../../domain-name/@) == x ]; \ +then \ +echo \\\"127.0.0.1\t localhost $(../../../host-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +else \ +echo \\\"127.0.0.1\t localhost \ +$(../../../host-name/@).$(../../../domain-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +fi\" " +delete: "sh -c \"touch /etc/hosts && \ +sed -i '/ $(../@) .*#vyatta entry/{/localhost/!d}' /etc/hosts\" " diff --git a/templates/system/static-host-mapping/host-name/node.tag/inet/node.def b/templates/system/static-host-mapping/host-name/node.tag/inet/node.def new file mode 100644 index 0000000..192273c --- /dev/null +++ b/templates/system/static-host-mapping/host-name/node.tag/inet/node.def @@ -0,0 +1,30 @@ +type: ipv4 +help: "Internet address" +create: "sh -c \"touch /etc/hosts && \ +sed -i '/$(../@).*#vyatta entry/d;/127\\.0\\.0\\.1.*#vyatta entry/d' \ +/etc/hosts && \ +echo \\\"$(@)\t $(../@) \t #vyatta entry\\\" >> /etc/hosts && \ +if [ x$(../../../domain-name/@) == x ]; \ +then \ +echo \\\"127.0.0.1\t localhost $(../../../host-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +else \ +echo \\\"127.0.0.1\t localhost \ +$(../../../host-name/@).$(../../../domain-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +fi\" " +update: "sh -c \"touch /etc/hosts && \ +sed -i '/$(../@).*#vyatta entry/d;/127\\.0\\.0\\.1.*#vyatta entry/d' \ +/etc/hosts && \ +echo \\\"$(@)\t $(../@) \t #vyatta entry\\\" >> /etc/hosts && \ +if [ x$(../../../domain-name/@) == x ]; \ +then \ +echo \\\"127.0.0.1\t localhost $(../../../host-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +else \ +echo \\\"127.0.0.1\t localhost \ +$(../../../host-name/@).$(../../../domain-name/@)\t #vyatta entry\\\" \ +>> /etc/hosts; \ +fi\" " +delete: "sh -c \"touch /etc/hosts && \ +sed -i '/ $(../@) .*#vyatta entry/{/localhost/!d}' /etc/hosts\" " diff --git a/templates/system/static-host-mapping/node.def b/templates/system/static-host-mapping/node.def new file mode 100644 index 0000000..736413f --- /dev/null +++ b/templates/system/static-host-mapping/node.def @@ -0,0 +1 @@ +help: "Map DNS names to system interfaces" |