Commit 960e20b0 authored by Leigh Stoller's avatar Leigh Stoller

Get rid of wrap in html <pre>, back to plain text. Use cat -v to

convert control chars for display.
parent bf77e242
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# Copyright (c) 2005-2015 University of Utah and the Flux Group. # Copyright (c) 2005-2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -184,13 +184,6 @@ else { ...@@ -184,13 +184,6 @@ else {
$logname = "$logdir/${node_id}.log"; $logname = "$logdir/${node_id}.log";
} }
if ($linecount) {
$cmd = "tail -". $linecount
}
else {
$cmd = "cat";
}
# #
# Run an ssh command in a child process, protected by an alarm to # Run an ssh command in a child process, protected by an alarm to
# ensure that the ssh is not hung up forever if the machine is in # ensure that the ssh is not hung up forever if the machine is in
...@@ -217,7 +210,14 @@ if ($syspid) { ...@@ -217,7 +210,14 @@ if ($syspid) {
# #
# Now we want to ssh over and cat the file. # Now we want to ssh over and cat the file.
# #
if ($linecount) {
$cmd = "tail -${linecount} $logname | cat -v";
}
else {
$cmd = "cat -v $logname";
}
$UID = 0; $UID = 0;
system("$SSH -host $tipserver $cmd $logname"); system("$SSH -host $tipserver $cmd");
$UID = $SAVEUID; $UID = $SAVEUID;
exit(($? == 0 ? 0 : 1)); exit(($? == 0 ? 0 : 1));
<?php <?php
# #
# Copyright (c) 2005-2015 University of Utah and the Flux Group. # Copyright (c) 2005-2016 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -111,12 +111,11 @@ if (! $fp) { ...@@ -111,12 +111,11 @@ if (! $fp) {
USERERROR("Spew console log failed!", 1); USERERROR("Spew console log failed!", 1);
} }
echo "<html> header("Content-Type: text/plain; charset=us-ascii");
<head> header("X-Content-Type-Options: nosniff");
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
<title>Console log for $node_id</title> header("Cache-Control: no-cache, must-revalidate");
</head> header("Pragma: no-cache");
<body><pre>\n";
flush(); flush();
while (!feof($fp)) { while (!feof($fp)) {
$string = fgets($fp, 1024); $string = fgets($fp, 1024);
...@@ -125,6 +124,5 @@ while (!feof($fp)) { ...@@ -125,6 +124,5 @@ while (!feof($fp)) {
} }
pclose($fp); pclose($fp);
$fp = 0; $fp = 0;
echo "</pre></body></html>\n";
?> ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment