نقل قول از man ping
If  ping  does not receive any reply packets at all it will exit with code
       1. If a packet count and deadline are both specified, and fewer than count
       packets  are  received  by the time the deadline has arrived, it will also
       exit with code 1.  On other error it exits with code 2. Otherwise it exits
       with  code 0. This makes it possible to use the exit code to see if a host
       is alive or not.
       This program is intended for use in network testing, measurement and  man‐
       agement.   Because  of the load it can impose on the network, it is unwise
       to use ping during normal operations or from automated scripts.unwise یعنی «غیر عاقلانه»