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

nc command not found #3

Open
Markhor-ff opened this issue Jun 8, 2023 · 0 comments
Open

nc command not found #3

Markhor-ff opened this issue Jun 8, 2023 · 0 comments

Comments

@Markhor-ff
Copy link

You can modify the script to handle the case when the "nc" command is not found. Replace the following line:

if nc -zw1 google.com 443; then

with:

if command -v nc &>/dev/null && nc -zw1 google.com 443; then

This change checks if the "nc" command is available using the command -v nc &>/dev/null command before attempting to use it. If the command is not found, it will not execute the nc -zw1 google.com 443 part, preventing the "command not found" error.

Make this modification in the script. It should handle the case when the "nc" command is not available and continue execution if there is an internet connection.

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

No branches or pull requests

1 participant