From: Don Armstrong <don@donarmstrong.com>
Date: Tue, 10 Feb 2015 21:48:26 +0000 (-0800)
Subject: make ping only ping once, and wait for a max of three seconds for a response
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8aa40a6264318236c4c237e17b2dd1283fa331c0;p=bin.git

make ping only ping once, and wait for a max of three seconds for a response
---

diff --git a/sshsendmail b/sshsendmail
index 62efbb4..c9c4530 100755
--- a/sshsendmail
+++ b/sshsendmail
@@ -164,7 +164,7 @@ EOF
 $Data::Dumper::Useqq=0;
 print STDERR Dumper(\@ssh_arguments);
 
-qx(ping -q -c 3 $hostname 2>/dev/null);
+qx(ping -q -w 3 -c 1 $hostname 2>/dev/null);
 if ($?) {
     syslog(LOG_WARNING,"${0}: Failed: unable to ping $hostname\n");
     exit (9);