Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. # if `HOST_IP` is manually configured as env
  2. HOST="$HOST_IP"
  3.  
  4. # try to get the ip of the host from ns host.docker.internal
  5. if [[ -z "$HOST" ]]; then
  6. HOST=$(getent hosts host.docker.internal | awk '{ print $1 }')
  7. fi
  8.  
  9. # try to get the linux host ip
  10. if [[ -z "$HOST" ]]; then
  11. HOST=$(ip route | awk 'NR==1 {print $3}')
  12. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement