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

Try to find ping executable at runtime #18

Merged
merged 1 commit into from
Mar 2, 2021
Merged

Try to find ping executable at runtime #18

merged 1 commit into from
Mar 2, 2021

Conversation

lotharsm
Copy link
Contributor

@lotharsm lotharsm commented Mar 2, 2021

Currently, the getStatus() function relies on the ping executable being located in /usr/bin/ping. Some systems (e.g. Gentoo) use other paths like /bin/ping which breaks this function.

By using which ping instead, we could try to find the executable at runtime instead of hardcoding the file location.

@iandk
Copy link
Owner

iandk commented Mar 2, 2021

yep, good idea!

Thanks!

@iandk iandk merged commit 5d42644 into iandk:main Mar 2, 2021
@lotharsm
Copy link
Contributor Author

lotharsm commented Mar 2, 2021

@Brueggus indeed, basically this just shifts the main problem.

@iandk I just tested it on Gentoo Linux, there it's enough to call ping directly without providing the absolute path to the executable...

What about setting /usr/bin/ping as the default and make the path to the ping command configurable somewhere?

@iandk
Copy link
Owner

iandk commented Mar 2, 2021

I think I'd keep your solution, works on valet and the other environments I tested it on.

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