bash - How to make "if not true condition"? - Stack Overflow
stackoverflow.com › questions › 10552711May 11, 2012 · Here is an answer by way of example: In order to make sure data loggers are online a cron script runs every 15 minutes that looks like this: #!/bin/bash # if ! ping -c 1 SOLAR &>/dev/null then echo "SUBJECT: SOLAR is not responding to ping" | ssmtp abc@def.com echo "SOLAR is not responding to ping" | ssmtp 4151112222@txt.att.com else echo "SOLAR is up" fi # if ! ping -c 1 OUTSIDE &>/dev/null ...