Answers for "how to check ip in bash"

0

bash get current ip

curl -4 ifconfig.co
Posted by: Guest on June-24-2021
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

Browse Popular Code Answers by Language