Bash Script to check if a host is alive
Script to check if a host is alive:
#!/bin/bash<br></br>
ping -c 2 www.amitnepal.com > /dev/null<br></br>
if [ $? -eq 0 ]; then<br></br>
echo "Alive";<br></br>
else<br></br>
echo "Dead";<br></br>
fi```
Script to check if a host is alive:
#!/bin/bash<br></br>
ping -c 2 www.amitnepal.com > /dev/null<br></br>
if [ $? -eq 0 ]; then<br></br>
echo "Alive";<br></br>
else<br></br>
echo "Dead";<br></br>
fi```