From 8269371588586fd4238d6606dd71c4ea1f466e4c Mon Sep 17 00:00:00 2001 From: kakwa Date: Wed, 17 Jun 2015 19:58:05 +0200 Subject: [PATCH] trying to fix /etc/hosts --- tests/test_env/deploy.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_env/deploy.sh b/tests/test_env/deploy.sh index 35405bf..996460c 100755 --- a/tests/test_env/deploy.sh +++ b/tests/test_env/deploy.sh @@ -33,7 +33,14 @@ chown -R openldap:openldap /etc/ldap/ rm /etc/ldap/slapd.d/cn\=config/*mdb* /etc/init.d/slapd restart ldapadd -c -H ldap://localhost:390 -x -D "cn=admin,dc=example,dc=org" -f /etc/ldap/content.ldif -w password -sed -i "s/\(127.0.0.1.*\)/\1 ldap.ldapcherry.org ad.ldapcherry.org ldap.dnscherry.org/" /etc/hosts +if grep -q '127.0.0.1' /etc/hosts +then + sed -i "s/\(127.0.0.1.*\)/\1 ldap.ldapcherry.org ad.ldapcherry.org ldap.dnscherry.org/" /etc/hosts +else + echo '127.0.0.1 ldap.ldapcherry.org ad.ldapcherry.org ldap.dnscherry.org' >> /etc/hosts +fi +cat /etc/hosts + df -h