2012-06-20 Hirofumi Kosaka <kosaka@rworks.jp>
* extensions/net_tools.php: Fixed bug: cannot find traceroute other than /usr/sbin/traceroute. Merged from 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6605 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0690e32063
commit
331820371e
|
@ -1,3 +1,9 @@
|
|||
2012-06-20 Hirofumi Kosaka <kosaka@rworks.jp>
|
||||
|
||||
* extensions/net_tools.php: Fixed bug: cannot find traceroute
|
||||
other than /usr/sbin/traceroute.
|
||||
Merged from 4.0.2
|
||||
|
||||
2012-06-20 Hirofumi Kosaka <kosaka@rworks.jp>
|
||||
|
||||
* include/functions.php: Changed ambiguous time representation
|
||||
|
|
|
@ -46,24 +46,36 @@ function main_net_tools () {
|
|||
echo "<input name=submit type=submit class='sub next' value='".__('Execute')."'>";
|
||||
echo "</tr></table>";
|
||||
echo "</form>";
|
||||
|
||||
|
||||
|
||||
|
||||
$operation = get_parameter ("operation",0);
|
||||
$community = get_parameter ("community","public");
|
||||
|
||||
|
||||
switch($operation) {
|
||||
case 1:
|
||||
if (!file_exists('/usr/sbin/traceroute')) {
|
||||
ui_print_error_message(__('Traceroute executable does not exist.'));
|
||||
}
|
||||
else {
|
||||
echo "<h3>".__("Traceroute to "). $ip. "</h3>";
|
||||
echo "<pre>";
|
||||
echo system ("/usr/sbin/traceroute $ip");
|
||||
echo "</pre>";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 1:
|
||||
ob_start();
|
||||
system('whereis traceroute');
|
||||
$output = ob_get_clean();
|
||||
$result = explode(':', $output);
|
||||
$result = trim($result[1]);
|
||||
if (! empty($result)) {
|
||||
echo "<h3>".__("Traceroute to "). $ip. "</h3>";
|
||||
echo "<pre>";
|
||||
echo system ("traceroute $ip");
|
||||
echo "</pre>";
|
||||
}
|
||||
elseif (file_exists('/usr/sbin/traceroute')) {
|
||||
echo "<h3>".__("Traceroute to "). $ip. "</h3>";
|
||||
echo "<pre>";
|
||||
echo system ("/usr/sbin/traceroute $ip");
|
||||
echo "</pre>";
|
||||
}
|
||||
else {
|
||||
ui_print_error_message(__('Traceroute executable does not exist.'));
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ob_start();
|
||||
system('whereis ping');
|
||||
$output = ob_get_clean();
|
||||
|
|
Loading…
Reference in New Issue