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

ruz at bestpractical.com ruz at bestpractical.com
Thu Jan 12 00:25:14 EST 2006


Author: ruz
Date: Thu Jan 12 00:25:13 2006
New Revision: 4379

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

Log:
 r601 at cubic-pc:  cubic | 2005-12-28 11:48:48 +0300
 * cleanups, loc, error checks


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	Thu Jan 12 00:25:13 2006
@@ -23,27 +23,27 @@
 %# 
 %# END LICENSE BLOCK
 <& /RTIR/Elements/Header, Title => $title &>
-<h1><%$title%></h1>
-% while (<TR>) {
-% sleep(2);
-% my $content = $_;
-% $m->comp('/RTIR/Elements/MakeClicky', content =>\$content);
-<%$content |n%><BR>
-% $m->flush_buffer();
-% }
-% close(TR);
-<%init>
-my $host;
-if ($q =~ /^[A-Z0-9.]+$/i) {
- $host = $q;
-open(TR, "/usr/sbin/traceroute $host|");
-tied(%session)->release_all_locks();
+<h1><% $title %></h1>
+<pre>
+<%PERL>
+while (my $content = <$tr>) {
+    $m->comp('/RTIR/Elements/MakeClicky', content => \$content);
+    $m->out( $content );
+    $m->out('<br />');
+    $m->flush_buffer;
+    sleep(2);
 }
-else {
+</%PERL>
+</pre>
+<%INIT>
+unless ( $q =~ /^[A-Z0-9.]+$/i ) {
     Abort("Invalid search query");
 }
-my $title = "Traceroute to ".$host;
-</%init>
-<%args>
-$q => undef
-</%args>
+
+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);
+</%INIT>
+<%ARGS>
+$q => ''
+</%ARGS>


More information about the Rt-commit mailing list