Skip to content

Commit

Permalink
Clean hosts file before adding the IP.
Browse files Browse the repository at this point in the history
  • Loading branch information
mindflayer committed May 30, 2024
1 parent 19d95ca commit 501088e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/patch_hosts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo cp /etc/hosts /etc/hosts.mocket
sudo grep -v httpbin.local /etc/hosts | sudo tee /etc/hosts.mocket
export CONTAINER_ID=$(docker compose ps -q proxy)
export CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $CONTAINER_ID)
echo "$CONTAINER_IP httpbin.local" | sudo tee -a /etc/hosts.mocket
Expand Down

0 comments on commit 501088e

Please sign in to comment.