Bash Check If Host Is Reachable
#!/bin/bash host=$1 ping -c 1 $host > /dev/null if [ $? -eq 0 ]; then echo "Host $host is reachable." else echo "Host $host is not reachable." fi
Similar Posts:
879
Bash Check If Host Is Reachable
#!/bin/bash host=$1 ping -c 1 $host > /dev/null if [ $? -eq 0 ]; then echo "Host $host is reachable." else echo "Host $host is not reachable." fi