Ask Your Question
0

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
0

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

qstack gravatar image

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

#!/bin/bash

ping -c 1 192.168.56.101 > /dev/null

if [ $? -eq 0 ]
then
    echo "Host is available"
else
    echo "Host is not available"
fi
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

Stats

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

Seen: 32 times

Last updated: Apr 07 '23