-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels