Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

was getting the wrong host ip #8

Open
OhioVR opened this issue Jan 12, 2019 · 1 comment
Open

was getting the wrong host ip #8

OhioVR opened this issue Jan 12, 2019 · 1 comment

Comments

@OhioVR
Copy link

OhioVR commented Jan 12, 2019

On my Ubuntu 16 server install the line:

SERVER_HOST=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | grep -oE '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | head -1)

was producing my server's lan IP and I was unable to connect to websites on iOS

Changing that line to:

SERVER_HOST="$(dig +short myip.opendns.com @resolver1.opendns.com)"

found my WAN IP and I was able to connect

I didn't do a pull request because I don't know if that would break other distros

@ghost
Copy link

ghost commented Jan 28, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant