main
This commit is contained in:
@@ -1,23 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Network jitter test runner.
|
||||
*
|
||||
* Lets the operator pick a target (BrandMeister / DMR+ / HBLink) and
|
||||
* runs `sudo /usr/local/sbin/pistar-jittertest <target>` on the
|
||||
* device; output streams to /var/log/pi-star/pi-star_icmptest.log
|
||||
* which this page tails via AJAX (jquery-timing $.repeat).
|
||||
*
|
||||
* Uses system()/exec() rather than the staged-write pattern — no
|
||||
* file edits, just a privileged background process.
|
||||
*/
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/config/security_headers.php');
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/config/banner_warnings.inc');
|
||||
setSecurityHeaders();
|
||||
|
||||
// Layer 2 of the default-password protection — see config/banner_warnings.inc.
|
||||
// MUST run BEFORE any output so header('Location: ...') works.
|
||||
pistar_warnings_enforce_redirect();
|
||||
|
||||
// Load the language support
|
||||
require_once('../config/language.php');
|
||||
// Load the Pi-Star Release file
|
||||
@@ -37,9 +18,8 @@ if ($_SERVER["PHP_SELF"] == "/admin/expert/jitter_test.php") {
|
||||
} else { $target = "DMR+"; }
|
||||
|
||||
if (!isset($_GET['ajax'])) {
|
||||
// truncate creates+clears the log file in one synchronous call —
|
||||
// see admin/update.php for the full rationale.
|
||||
system('sudo truncate -s 0 /var/log/pi-star/pi-star_icmptest.log');
|
||||
system('sudo touch /var/log/pi-star/pi-star_icmptest.log > /dev/null 2>&1 &');
|
||||
system('sudo echo "" > /var/log/pi-star/pi-star_icmptest.log > /dev/null 2>&1 &');
|
||||
system('sudo /usr/local/sbin/pistar-jittertest '.$target.' > /dev/null 2>&1 &');
|
||||
}
|
||||
|
||||
@@ -88,13 +68,13 @@ if ($_SERVER["PHP_SELF"] == "/admin/expert/jitter_test.php") {
|
||||
<meta name="language" content="English" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<meta name="Author" content="Andrew Taylor (MW0MWZ)" />
|
||||
<meta name="Description" content="Pi-Star Update" />
|
||||
<meta name="KeyWords" content="Pi-Star" />
|
||||
<meta name="Description" content="CDN Update" />
|
||||
<meta name="KeyWords" content="CDN" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<title>Pi-Star - <?php echo $lang['digital_voice']." ".$lang['dashboard']." - ".$lang['update'];?></title>
|
||||
<title>CDN - <?php echo $lang['digital_voice']." ".$lang['dashboard']." - ".$lang['update'];?></title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/pistar-css.php" />
|
||||
<script type="text/javascript" src="/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/jquery-timing.min.js"></script>
|
||||
@@ -114,20 +94,13 @@ if ($_SERVER["PHP_SELF"] == "/admin/expert/jitter_test.php") {
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<?php pistar_warnings_render(); ?>
|
||||
<div class="container">
|
||||
<?php include './header-menu.inc'; ?>
|
||||
<div class="contentwide">
|
||||
<table width="100%">
|
||||
<tr><th>Test Running</th></tr>
|
||||
<tr><td align="left"><div id="tail">Starting test, please wait...<br /></div></td></tr>
|
||||
</table>
|
||||
<h2>Jitter Test Running</h2>
|
||||
<div class="settings-card" style="padding-top:16px;">
|
||||
<div id="tail">Starting test, please wait...<br /></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Pi-Star web config, © Andy Taylor (MW0MWZ) 2014-<?php echo date("Y"); ?>.<br />
|
||||
Need help? Click <a style="color: #ffffff;" href="https://www.facebook.com/groups/pistarusergroup/" target="_new">here for the Support Group</a><br />
|
||||
Get your copy of Pi-Star from <a style="color: #ffffff;" href="http://www.pistar.uk/downloads/" target="_blank">here</a>.<br />
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
@@ -135,3 +108,4 @@ if ($_SERVER["PHP_SELF"] == "/admin/expert/jitter_test.php") {
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user