Question: I want to write a script, that would keep checking if any of the devices in network, that should be online all day long, are really online. I tried to use ping, but

```
if [ "`ping -c 1 some_ip_here`" ]
then
  echo 1
else
  echo 0
fi

```

gives `1` no matter if I enter valid or invalid ip address. How can I check if a specific address (or better any of devices from list of ip addresses) went offline?

Answer: 
FYI,
I just did some test using the method above and if we use multi ping (10 requests)

> 
> ping -c10 8.8.8.8 &> /dev/null ; echo $?
> 
> 
> 

the result of multi ping command will be "0" if at least one of ping result reachable,
and "1" in case where all ping requests are unreachable.
```
up=`fping -r 1 $1 `
if [ -z "${up}" ]; then
    printf "Host $1 not responding to ping   \n"
    else
    printf "Host $1 responding to ping  \n"
fi

```