[Rt-commit] r4391 - in rtir/branches/1.9-EXPERIMENTAL: etc html/RTIR/Tools

ruz at bestpractical.com ruz at bestpractical.com
Fri Jan 13 06:41:43 EST 2006


Author: ruz
Date: Fri Jan 13 06:41:39 2006
New Revision: 4391

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/etc/RTIR_Config.pm
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Traceroute.html

Log:
 r611 at cubic-pc:  cubic | 2006-01-13 14:35:46 +0300
 * new config option $TracerouteCommand


Modified: rtir/branches/1.9-EXPERIMENTAL/etc/RTIR_Config.pm
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/etc/RTIR_Config.pm	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/etc/RTIR_Config.pm	Fri Jan 13 06:41:39 2006
@@ -237,6 +237,8 @@
 # on the edit screen.
 Set($DisplayAfterEdit, 1);
 
+Set($TracerouteCommand, '/usr/bin/traceroute');
+
 # Components that available to add on the first page of the RTIR
 Set($RTIR_HomepageComponents, [qw(
     /RTIR/Elements/NewReports

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Traceroute.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Traceroute.html	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Tools/Traceroute.html	Fri Jan 13 06:41:39 2006
@@ -39,10 +39,13 @@
 unless ( $q =~ /^[A-Z0-9.]+$/i ) {
     Abort("Invalid search query");
 }
+my $title = loc("Traceroute to '[_1]'.", $q);
+
+my $cmd = $RT::TracerouteCommand || '/usr/sbin/traceroute';
+Abort("Couldn't find '$cmd' or run it's not executable") unless -f $cmd && -x _;
 
 tied(%session)->release_all_locks;
-open my $tr, "/usr/sbin/traceroute $q|" or Abort("Couldn't run '/usr/sbin/traceroute': $!");
-my $title = loc("Traceroute to '[_1]'.", $q);
+open my $tr, "$cmd $q|" or Abort("Couldn't run '/usr/sbin/traceroute': $!");
 </%INIT>
 <%ARGS>
 $q => ''


More information about the Rt-commit mailing list