Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove ping test, not a guarantee for internet connectivity #18

Closed
wants to merge 1 commit into from
Closed

remove ping test, not a guarantee for internet connectivity #18

wants to merge 1 commit into from

Conversation

ralphtheninja
Copy link

I'm behind a firewall that doesn't allow ping, which results in 100% packet loss, but the internet connection is just fine. Mind removing the check altogether? Or can we introduce some other way of checking connection, or add a seam so it can be disabled?

@reixd
Copy link

reixd commented May 2, 2017

Instead of deleting the meaningful internet connectivity test for all users, you could use a command line argument (set to false) to disable this test.
See a bash getops example http://mywiki.wooledge.org/BashFAQ/035#getopts

An usage example would be:

./start.sh --disable-internet-check

DISABLE_INTERNET_CHECK=0
OPTIND=1

while getopts hvf: opt; do
     case $opt in
         disable-internet-check)
             DISABLE_INTERNET_CHECK=1
             ;;
     esac
 done
shift "$((OPTIND-1))" # Shift off the options and optional --.

# Test the connection, wait if needed.
while [[ ${DISABLE_INTERNET_CHECK} -eq 0 ]] && [[ $(ping -c1 google.com 2>&1 | grep " 0% packet loss") == "" ]]; do		
  echo "[TTN Gateway]: Waiting for internet connection..."		
   sleep 30		
done		

See the additional test in the while loop.

@ralphtheninja
Copy link
Author

Thanks for feedback!

@alexxtasi
Copy link

Hi all !
I have the same issue while testing a gateway inside a network with firewall. And it took me some time to finger it out !! I think this workaround would help in these situations.

  • is the above workaround part of the project already ?
  • do you think there is no reason for ?
  • in my opinion it is a good idea... but how would the start.sh with params work with the code ?

thanks !

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

Successfully merging this pull request may close these issues.

3 participants