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