Shell/Bash: how to check if ip is up bash script Example

By

Shell/Bash Example: This is the "how to check if ip is up bash script" Example. compiled from many sources on the internet by SimpleTutorials.org

how to check if ip is up bash script

#!/bin/bash
IP='192.168.1.1'
fping -c1 -t300 $IP 2>/dev/null 1>/dev/null
if [ "$?" = 0 ]
then
  echo "Host found"
else
  echo "Host not found"
fi



* Summary: This "how to check if ip is up bash script" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others