Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Add fix to get host ip for Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ruescar committed Jun 23, 2019
1 parent b6c260a commit 3fef1dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion selenium/build-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ if [ "$browser" == "chrome/local" -o "$browser" == "opera/blink/local" -o "$brow
cp $debWildcard "$dir_name"
docker rm -f static-server || true
docker run -d -p 8080:8043 -v "$dir_name":/srv/http --name static-server pierrezemb/gostatic
host_ip=$(ifconfig docker0 | grep inet | grep -v inet6 | awk '{print $2;}' | sed -e 's|addr:||g')
if [ $(uname) == "Darwin" ]; then
host_ip=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)
else
host_ip=$(ifconfig docker0 | grep inet | grep -v inet6 | awk '{print $2;}' | sed -e 's|addr:||g')
fi
if [ -z "$host_ip" ]; then
echo "Failed to determine host machine IP..."
exit 1
Expand Down

0 comments on commit 3fef1dd

Please sign in to comment.