Ask Your Question

Bash Script that checks if a Host is available or not?

asked 2023-04-03 22:51:05 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-04-03 22:51:25 +0000

qstack gravatar image

updated 2023-04-07 18:18:47 +0000


ping -c 1 > /dev/null

if [ $? -eq 0 ]
    echo "Host is available"
    echo "Host is not available"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer

Question Tools

1 follower


Asked: 2023-04-03 22:51:05 +0000

Seen: 32 times

Last updated: Apr 07 '23