From cf0011c11c7326afdaded64a891033999e539db1 Mon Sep 17 00:00:00 2001 From: Bob Motram Date: Mon, 2 Mar 2015 20:54:19 +0000 Subject: [PATCH] Duplicated entry in /etc/hosts --- src/freedombone | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/freedombone b/src/freedombone index a3483b5e..8b2ba0bf 100755 --- a/src/freedombone +++ b/src/freedombone @@ -4396,8 +4396,11 @@ function set_your_domain_name { fi echo "$DEFAULT_DOMAIN_NAME" > /etc/hostname hostname $DEFAULT_DOMAIN_NAME - sed -i "s/127.0.1.1.*/127.0.1.1 $DEFAULT_DOMAIN_NAME/g" /etc/hosts - echo "127.0.1.1 $DEFAULT_DOMAIN_NAME" >> /etc/hosts + if grep -q "127.0.1.1" /etc/hosts; then + sed -i "s/127.0.1.1.*/127.0.1.1 $DEFAULT_DOMAIN_NAME/g" /etc/hosts + else + echo "127.0.1.1 $DEFAULT_DOMAIN_NAME" >> /etc/hosts + fi echo 'set_your_domain_name' >> $COMPLETION_FILE } @@ -8047,7 +8050,7 @@ function intrusion_detection { sed -i 's|/var/log.*||g' /etc/tripwire/twpol.txt # Ignore /etc/tripwire if ! grep -q "!/etc/tripwire" /etc/tripwire/twpol.txt; then - sed -i '\|/etc\t\t->.*|a\ !/etc/tripwire;' /etc/tripwire/twpol.txt + sed -i '\|/etc\t\t->.*|a\ !/etc/tripwire;' /etc/tripwire/twpol.txt fi # Avoid logging the changed database sed -i 's|$(TWETC)/tw.pol.*||g' /etc/tripwire/twpol.txt