#!/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
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
Asked: 2023-04-03 22:51:05 +0000
Seen: 10 times
Last updated: Apr 07
How can I print all but the first 1000 Lines from a File in Bash?
How can I check the expiry of a SSL certificate in the Command Line?
How can I only get the Column with the Filename from a ls -all output with Awk?
What is the Difference of "source script.sh" and "./script.sh" in Bash?
How can I fix error: Security violation, ping RPC from uid 1001 in Slurm log?
I want to grep for "```*" in a File, in other Words: "```" followed by any Word
Sed: I want to remove a Word after all ``` in the given File
Bash: How can I move all files containing a certain pattern to a different directory?