From 6daef66ece027387b65bc0bbcf92d074b8417b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Mon, 19 Jan 2009 14:29:15 +0000 Subject: [PATCH] Fixed ping to work better on linux git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1162 44740490-163a-0410-bde0-09ae8108e29a --- modules/ldapstatus/www/index.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ldapstatus/www/index.php b/modules/ldapstatus/www/index.php index 196d99507..0cc6dd6c4 100644 --- a/modules/ldapstatus/www/index.php +++ b/modules/ldapstatus/www/index.php @@ -31,12 +31,13 @@ foreach ($orgs AS $orgkey => $orgconfig) { $results[$orgkey]['configMeta'] = checkConfig($orgconfig, array('enable_tls', 'testUser', 'testPassword', 'contactMail', 'contactURL')); $url = parse_url($orgconfig['hostname']); -// print_r($orgconfig['hostname']); -// print_r($url); exit; + $pingreturn = NULL; $pingoutput = NULL; - exec('ping -o -t 1 -c 1 ' . escapeshellcmd($url['host']), $pingoutput, $pingreturn); + exec('ping -W 1 -c 1 ' . escapeshellcmd($url['host']), $pingoutput, $pingreturn); + # echo $pingreturn; exit; + if ($pingreturn == '0') { $results[$orgkey]['ping'] = array(TRUE,join("\r\n", $pingoutput)); } else { -- GitLab