Skip to content

Commit 501088e

Browse files
committed
Clean hosts file before adding the IP.
1 parent 19d95ca commit 501088e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/patch_hosts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sudo cp /etc/hosts /etc/hosts.mocket
1+
sudo grep -v httpbin.local /etc/hosts | sudo tee /etc/hosts.mocket
22
export CONTAINER_ID=$(docker compose ps -q proxy)
33
export CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $CONTAINER_ID)
44
echo "$CONTAINER_IP httpbin.local" | sudo tee -a /etc/hosts.mocket

0 commit comments

Comments
 (0)