Answers for "how to check if ip is up bash script"

2

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
Posted by: Guest on May-25-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language