You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: