summaryrefslogtreecommitdiff
path: root/templates/system/host-name
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-24 10:01:04 -0700
committerAn-Cheng Huang <ancheng@sydney.vyatta.com>2007-10-24 10:01:04 -0700
commit1229e8c6f130c62c42900f424a772d4e9c5e8ef5 (patch)
treea89f7b29d4a7e62c803f3b0306922777681f319a /templates/system/host-name
parentb1fcb904eab1425d349fd7ab8d65b39c1bfb2e3f (diff)
downloadvyatta-cfg-system-1229e8c6f130c62c42900f424a772d4e9c5e8ef5.tar.gz
vyatta-cfg-system-1229e8c6f130c62c42900f424a772d4e9c5e8ef5.zip
add 'sudo' for 'system' and 'service/ssh' configuration commands.
Diffstat (limited to 'templates/system/host-name')
-rw-r--r--templates/system/host-name/node.def10
1 files changed, 2 insertions, 8 deletions
diff --git a/templates/system/host-name/node.def b/templates/system/host-name/node.def
index fc7c91ba..33ba25e1 100644
--- a/templates/system/host-name/node.def
+++ b/templates/system/host-name/node.def
@@ -2,14 +2,8 @@ type: txt
help: "Configure system host name"
default: "vyatta"
syntax: pattern $(@) "^[-a-zA-Z0-9.]+$" ; "invalid host name $(@)"
-create: "sh -c \"hostname '$(@)' && \
-touch /etc/hosts && \
-sed -i '/localhost/d' /etc/hosts && \
-echo \\\"127.0.0.1\t localhost $(@)\t #vyatta entry\\\" >> /etc/hosts && \
-if [ x$(../domain-name/@) != x ]; then \
-echo \\\"127.0.0.1\t localhost $(@).$(../domain-name/@)\t #vyatta entry\\\" \>> /etc/hosts; fi\" "
# do we need to add ntpd restart here?
-update: "sh -c \"hostname '$(@)' && \
+update: "sudo sh -c \"hostname '$(@)' && \
touch /etc/hosts && \
sed -i '/localhost/d' /etc/hosts && \
echo \\\"127.0.0.1\t localhost $(@)\t #vyatta entry\\\" >> /etc/hosts && \
@@ -17,7 +11,7 @@ if [ x$(../domain-name/@) != x ]; then \
echo \\\"127.0.0.1\t localhost $(@).$(../domain-name/@)\t #vyatta entry\\\" \
>> /etc/hosts; fi\" "
# do we need to add ntpd restart here?
-delete: "sh -c \"echo > /etc/hostname.conf && hostname '' && \
+delete: "sudo sh -c \"echo > /etc/hostname.conf && hostname '' && \
touch /etc/hosts && \
sed -i '/localhost.*#vyatta entry/d' /etc/hosts && \
if [ -f /etc/ntp/ntp.conf ] && grep -q 'server' /etc/ntp/ntp.conf; then \