Last active
November 6, 2024 10:28
-
-
Save addeeandra/9a6e351f11153aa3c1fceab84736ea2a to your computer and use it in GitHub Desktop.
A snippet of bash script to check connectivity via `ping` and `curl` command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IP_VLAN=10.22.2.1 | |
if curl -s $IP_VLAN > /dev/null; then | |
echo "Access to $IP_VLAN (vlan) is open." | |
else | |
echo "Access to $IP_VLAN (vlan) is not available." | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IP_VLAN=10.22.2.1 | |
if ping -c 4 $IP_VLAN > /dev/null; then | |
echo "Connection to $IP_VLAN (vlan) is up." | |
else | |
echo "Connection to $IP_VLAN (vlan) is down." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment