[Ovirt-devel] [PATCH node] changed fickle anyterm sysconfig changes to something more rebust

Mohammed Morsi mmorsi at redhat.com
Mon Aug 3 21:37:58 UTC 2009


instead of sed'ing the exact commented line we are looking for, simply
add the necessary lines to the end of the anyterm sysconf
---
 scripts/ovirt-functions |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions
index af3a257..1c7b0c4 100644
--- a/scripts/ovirt-functions
+++ b/scripts/ovirt-functions
@@ -213,11 +213,10 @@ ovirt_setup_libvirtd() {
 
 ovirt_setup_anyterm() {
    # configure anyterm
-   sed -i -e 's/^# ANYTERM_CMD=\/usr\/bin\/anyterm-cmd/ANYTERM_CMD="sudo \/usr\/bin\/virsh console %p"/' \
-        /etc/sysconfig/anyterm
-
-   sed -i -e 's/^# ANYTERM_LOCAL_ONLY=true/ANYTERM_LOCAL_ONLY=false/' \
-        /etc/sysconfig/anyterm
+   cat >> /etc/sysconfig/anyterm << EOF
+     ANYTERM_CMD="sudo /usr/bin/virsh console %p"
+     ANYTERM_LOCAL_ONLY=false
+   EOF
 
    # permit it to run the virsh console
    echo "anyterm ALL=NOPASSWD: /usr/bin/virsh console *" >> /etc/sudoers
-- 
1.6.0.6




More information about the ovirt-devel mailing list