Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #ip #bash #script
ADD COMMENT
Topic
Name
5+9 =