Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit d5baf70

Browse files
committed
Clean up stale records in /etc/hosts before adding new ones with the same host #80
1 parent c448fd3 commit d5baf70

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,4 +451,3 @@ bash ./<test-name>.sh
451451
* Make changes in `etc/docker/monolith/Dockerfile`
452452
* Run `./k-upgrade-environment`
453453
* Run `./k-status` to open kubernetes dashboard and delete Replica Set named `magento2-monolith-*`. The container should be restarted and its Age should reset
454-
1. If you are unable to ping your local Magento install, open the `/etc/hosts` file and search for your Magento instance URL. If you find multiple references to the same URL, preserve the first one you find and delete the others.

scripts/host/configure_etc_hosts.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ if [[ ${debug_devbox_project} -eq 1 ]]; then
1414
set -x
1515
fi
1616

17+
# remove potentially stale configuration of the hosts configured by the dev box
18+
for instance_name in $(getInstanceList); do
19+
domain_name="$(getInstanceDomainName ${instance_name})"
20+
sudo sed -ie "/.*${domain_name}.*/d" /etc/hosts
21+
done
22+
1723
etc_hosts_records="$(bash "${devbox_dir}/scripts/host/get_etc_hosts_records.sh")"
1824
# only split with new lines
1925
IFS=$'\n'

0 commit comments

Comments
 (0)