summaryrefslogtreecommitdiff
path: root/templates/system/host-name/node.def
blob: 97d9a36b2c690acb64301b6e4a53bfaf38b58c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
type: txt
help: "Configure system host name"
default: "vyatta"
syntax: pattern $(@) "^[-a-zA-Z0-9.]+$" ; "invalid host name $(@)"
update: "sudo sh -c \"hostname '$(@)' && \
touch /etc/hosts && \
sed -i '/^127.0.1.1/d' /etc/hosts && \
echo \\\"127.0.1.1\t $(@)\t #vyatta entry\\\" >> /etc/hosts && \
if [ x$(../domain-name/@) != x ]; then \
echo \\\"127.0.1.1\t $(@).$(../domain-name/@)\t #vyatta entry\\\" \
>> /etc/hosts; fi\" "
delete: "sudo sh -c \"echo > /etc/hostname.conf && 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$(../domain-name/@) != x ]; then \
echo \\\"127.0.1.1\t vyatta.$(../domain-name/@)\t #vyatta entry\\\" \
>> /etc/hosts; fi\" "