summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2008-02-06 17:20:55 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2008-02-06 17:20:55 -0800
commit12f269b74d05a2a11be7f0aaf993faeb56321f2f (patch)
tree9a8fa2e8c9a0ebf59b5cb7eb1bc01e4734c2da18 /templates
parent1bfb6d05e36905581abdc000d9f5801d3541b1be (diff)
downloadvyatta-cfg-system-12f269b74d05a2a11be7f0aaf993faeb56321f2f.tar.gz
vyatta-cfg-system-12f269b74d05a2a11be7f0aaf993faeb56321f2f.zip
template cleanup and fix for bug 2785: update /etc/mailname with hostname.
Diffstat (limited to 'templates')
-rw-r--r--templates/system/host-name/node.def44
1 files changed, 28 insertions, 16 deletions
diff --git a/templates/system/host-name/node.def b/templates/system/host-name/node.def
index e7e3d20b..54ed9fef 100644
--- a/templates/system/host-name/node.def
+++ b/templates/system/host-name/node.def
@@ -1,19 +1,31 @@
type: txt
help: Configure system host name
default: "vyatta"
-syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]+$" ; "invalid host name $VAR(@)"
-update:expression: "sudo sh -c \"hostname '$VAR(@)' && \
-echo '$VAR(@)' > /etc/hostname && \
-touch /etc/hosts && \
-sed -i '/^127.0.1.1/d' /etc/hosts && \
-echo \\\"127.0.1.1\t $VAR(@)\t #vyatta entry\\\" >> /etc/hosts && \
-if [ x$VAR(../domain-name/@) != x ]; then \
-echo \\\"127.0.1.1\t $VAR(@).$VAR(../domain-name/@)\t #vyatta entry\\\" \
->> /etc/hosts; fi\" "
-delete:expression: "sudo sh -c \"echo 'vyatta' > /etc/hostname && hostname 'vyatta' && \
-touch /etc/hosts && \
-sed -i '/^127.0.1.1/d' /etc/hosts && \
-echo \\\"127.0.1.1\t vyatta\t #vyatta entry\\\" >> /etc/hosts && \
-if [ x$VAR(../domain-name/@) != x ]; then \
-echo \\\"127.0.1.1\t vyatta.$VAR(../domain-name/@)\t #vyatta entry\\\" \
->> /etc/hosts; fi\" "
+syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]+$"
+ ; "invalid host name $VAR(@)"
+update: sudo sh -c " \
+ hostname '$VAR(@)'
+ echo '$VAR(@)' > /etc/hostname
+ touch /etc/hosts
+ sed -i '/^127.0.1.1/d' /etc/hosts
+ echo -e \"127.0.1.1\t $VAR(@)\t #vyatta entry\" >> /etc/hosts
+ if [ x$VAR(../domain-name/@) != x ]; then
+ echo -e \"127.0.1.1\t $VAR(@).$VAR(../domain-name/@)\t #vyatta entry\" \
+ >> /etc/hosts
+ echo \"$VAR(@).$VAR(../domain-name/@)\" > /etc/mailname
+ else
+ echo \"$VAR(@)\" > /etc/mailname
+ fi"
+delete: sudo sh -c " \
+ echo 'vyatta' > /etc/hostname
+ hostname 'vyatta'
+ touch /etc/hosts
+ sed -i '/^127.0.1.1/d' /etc/hosts
+ echo -e \"127.0.1.1\t vyatta\t #vyatta entry\" >> /etc/hosts
+ if [ x$VAR(../domain-name/@) != x ]; then
+ echo -e \"127.0.1.1\t vyatta.$VAR(../domain-name/@)\t #vyatta entry\" \
+ >> /etc/hosts
+ echo \"vyatta.$VAR(../domain-name/@)\" > /etc/mailname
+ else
+ echo \"vyatta\" > /etc/mailname
+ fi"