From 1229e8c6f130c62c42900f424a772d4e9c5e8ef5 Mon Sep 17 00:00:00 2001
From: An-Cheng Huang <ancheng@sydney.vyatta.com>
Date: Wed, 24 Oct 2007 10:01:04 -0700
Subject: add 'sudo' for 'system' and 'service/ssh' configuration commands.

---
 templates/system/host-name/node.def | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

(limited to 'templates/system/host-name/node.def')

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 \
-- 
cgit v1.2.3

