From 51b65b2846072dbafdb0a1ed6751a17fbe3e3a26 Mon Sep 17 00:00:00 2001 From: jsatoh Date: Sun, 29 Sep 2013 13:22:53 +0000 Subject: [PATCH] 2013-09-29 Junichi Satoh * include/ajax/events.php: Added timeout binary paths to execute commands for FreeBSD and NetBSD. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8824 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/ajax/events.php | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3d5f6dbb6e..43e3289e46 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-09-29 Junichi Satoh + + * include/ajax/events.php: Added timeout binary paths to execute + commands for FreeBSD and NetBSD. + 2013-09-29 Junichi Satoh * include/functions_reporting.php: Added missing %s. diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 8c584096ca..7f69ed3f7c 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -121,7 +121,18 @@ if ($perform_event_response) { $command = get_parameter('target',''); - echo system('/usr/bin/timeout 10 '.io_safe_output($command).' 2>&1'); + switch (PHP_OS) { + case "FreeBSD": + $timeout_bin = '/usr/local/bin/gtimeout'; + break; + case "NetBSD": + $timeout_bin = '/usr/pkg/bin/gtimeout'; + break; + default: + $timeout_bin = '/usr/bin/timeout'; + break; + } + echo system($timeout_bin . ' 10 '.io_safe_output($command).' 2>&1'); return; }