main
This commit is contained in:
@@ -1 +0,0 @@
|
||||
../dstarrepeater/
|
||||
@@ -0,0 +1,187 @@
|
||||
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code
|
||||
$configs = array();
|
||||
|
||||
if ($configfile = fopen($gatewayConfigPath,'r')) {
|
||||
while ($line = fgets($configfile)) {
|
||||
list($key,$value) = preg_split('/=/',$line);
|
||||
$value = trim(str_replace('"','',$value));
|
||||
if ($key != 'ircddbPassword' && strlen($value) > 0)
|
||||
$configs[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
$rev="20141101";
|
||||
$MYCALL=strtoupper($callsign);
|
||||
?>
|
||||
<b><?php echo $lang['d-star_link_status'];?></b>
|
||||
<table>
|
||||
<tr>
|
||||
<th><a class="tooltip" href="#">Radio<span><b>Radio Module</b></span></a></th>
|
||||
<th><a class="tooltip" href="#">Default<span><b>Default Link Destination</b></span></a></th>
|
||||
<th><a class="tooltip" href="#">Auto<span><b>AutoLink</b>- green: enabled<br />- red: disabled</span></a></th>
|
||||
<th><a class="tooltip" href="#">Timer<span><b>Reset/Restart Timer</b></span></a></th>
|
||||
<th><a class="tooltip" href="#">Link<span><b>Link-Status</b>- green: enabled<br />- red: disabled</span></a></th>
|
||||
<th><a class="tooltip" href="#">Linked to<span><b>Linked Destination</b></span></a></th>
|
||||
<th><a class="tooltip" href="#">Mode<span><b>Mode or Protocol used</b></span></a></th>
|
||||
<th><a class="tooltip" href="#">Direction<span><b>Direction</b>Incoming or Outgoing</span></a></th>
|
||||
<th><a class="tooltip" href="#">Last Change (<?php echo date('T')?>)<span><b>Timestamp of last change</b>Time of last change in <?php echo date('T')?> time zone</span></a></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$tot = array(0=>"Never",1=>"Fixed",2=>"5min",3=>"10min",4=>"15min",5=>"20min",6=>"25min",7=>"30min",8=>"60min",9=>"90min",10=>"120min",11=>"180min",12=>" ");
|
||||
$ci = 0;
|
||||
$tr = 0;
|
||||
for($i = 1;$i < 5; $i++){
|
||||
$param="repeaterBand" . $i;
|
||||
if((isset($configs[$param])) && strlen($configs[$param]) == 1) {
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
print "<tr>";
|
||||
$tr = 1;
|
||||
$module = $configs[$param];
|
||||
$rcall = sprintf("%-7.7s%-1.1s",$MYCALL,$module);
|
||||
$param="repeaterCall" . $i;
|
||||
if(isset($configs[$param])) { $rptrcall=sprintf("%-7.7s%-1.1s",$configs[$param],$module); } else { $rptrcall = $rcall;}
|
||||
print "<td>".str_replace(' ', ' ', substr($rptrcall,0,8))."</td>";
|
||||
$param="reflector" . $i;
|
||||
if(isset($configs[$param])) { print "<td>".str_replace(' ', ' ', substr($configs[$param],0,8))."</td>"; } else { print "<td> </td>";}
|
||||
$param="atStartup" . $i;
|
||||
if($configs[$param] == 1){print "<td>Auto</td>"; } else { print "<td>No</td>"; }
|
||||
$param="reconnect" . $i;
|
||||
if(isset($configs[$param])) { $t = $configs[$param]; } else { $t = 0; }
|
||||
if($t > 12){ $t = 12; }
|
||||
print "<td>$tot[$t]</td>";
|
||||
$j=0;
|
||||
if ($linkLog = fopen($linkLogPath,'r')) {
|
||||
while ($linkLine = fgets($linkLog)) {
|
||||
//$statimg = "<img src=\"images/20red.png\">";
|
||||
$statimg = "Down";
|
||||
$linkDate = " ";
|
||||
$protocol = " ";
|
||||
$linkType = " ";
|
||||
$linkRptr = " ";
|
||||
$linkRefl = " ";
|
||||
// Reflector-Link, sample:
|
||||
// 2011-09-22 02:15:06: DExtra link - Type: Repeater Rptr: DB0LJ B Refl: XRF023 A Dir: Outgoing
|
||||
// 2012-10-12 17:15:45: DCS link - Type: Repeater Rptr: DB0LJ B Refl: DCS001 L Dir: Outgoing
|
||||
// 2012-10-12 17:56:10: DCS link - Type: Repeater Rptr: DB0RPL B Refl: DCS015 B Dir: Outgoing
|
||||
if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*Rptr: (.{8}).*Refl: (.{8}).*Dir: Outgoing$/',$linkLine,$linx) > 0){
|
||||
$statimg = "Up";
|
||||
$linkDate = date("d-M-Y H:i:s", strtotime(substr($linx[1][0],0,19)));
|
||||
$protocol = $linx[2][0];
|
||||
$linkType = $linx[3][0];
|
||||
$linkRptr = $linx[4][0];
|
||||
$linkRefl = $linx[5][0];
|
||||
if($linkRptr == $rptrcall){
|
||||
print "<td>$statimg</td>";
|
||||
print "<td>".str_replace(' ', ' ', substr($linkRefl,0,8))."</td>";
|
||||
print "<td>$protocol</td>";
|
||||
print "<td>Outgoing</td>";
|
||||
$utc_time = $linkDate;
|
||||
$utc_tz = new DateTimeZone('UTC');
|
||||
$local_tz = new DateTimeZone(date_default_timezone_get ());
|
||||
$dt = new DateTime($utc_time, $utc_tz);
|
||||
$dt->setTimeZone($local_tz);
|
||||
$local_time = $dt->format('H:i:s M jS');
|
||||
print "<td>$local_time</td>";
|
||||
print "</tr>\n";
|
||||
$tr = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($linkLog);
|
||||
}
|
||||
|
||||
if ($tr == 1){
|
||||
print"<td>Down</td><td>None</td><td>--</td><td>----</td><td>----</td></tr>\n";
|
||||
}
|
||||
// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122
|
||||
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
// 2012-05-08 21:16:31: DExtra link - Type: Repeater Rptr: DB0LJ A Refl: DB0MYK B Dir: Incoming
|
||||
// 2012-05-08 21:16:31: DPlus link - Type: Dongle User: W1CDG H Dir: Incoming
|
||||
if ($linkLog = fopen($linkLogPath,'r')) {
|
||||
while ($linkLine = fgets($linkLog)) {
|
||||
$statimg = "Down";
|
||||
$linkDate = " ";
|
||||
$protocol = " ";
|
||||
$linkType = " ";
|
||||
$linkRptr = " ";
|
||||
$linkRefl = " ";
|
||||
if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*Rptr: (.{8}).*Refl: (.{8}).*Dir: Incoming$/',$linkLine,$linx) > 0){
|
||||
$statimg = "Up";
|
||||
$linkDate = date("d-M-Y H:i:s", strtotime(substr($linx[1][0],0,19)));
|
||||
$protocol = $linx[2][0];
|
||||
$linkType = $linx[3][0];
|
||||
$linkRptr = $linx[4][0];
|
||||
$linkRefl = $linx[5][0];
|
||||
if($linkRptr == $rptrcall){
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
print "<tr>";
|
||||
print "<td>".str_replace(' ', ' ', substr($rptrcall,0,8))."</td>";
|
||||
print "<td> </td><td> </td><td> </td>";
|
||||
print "<td>$statimg</td>";
|
||||
print "<td>".str_replace(' ', ' ', substr($linkRefl,0,8))."</td>";
|
||||
print "<td>$protocol</td>";
|
||||
print "<td>Incoming</td>";
|
||||
$utc_time = $linkDate;
|
||||
$utc_tz = new DateTimeZone('UTC');
|
||||
$local_tz = new DateTimeZone(date_default_timezone_get ());
|
||||
$dt = new DateTime($utc_time, $utc_tz);
|
||||
$dt->setTimeZone($local_tz);
|
||||
$local_time = $dt->format('H:i:s M jS');
|
||||
print "<td>$local_time</td>";
|
||||
print "</tr>\n";
|
||||
//$tr = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($linkLog);
|
||||
}
|
||||
// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122
|
||||
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
// 2012-05-08 21:16:31: DExtra link - Type: Repeater Rptr: DB0LJ A Refl: DB0MYK B Dir: Incoming
|
||||
// 2012-05-08 21:16:31: DPlus link - Type: Dongle User: W1CDG H Dir: Incoming
|
||||
if ($linkLog = fopen($linkLogPath,'r')) {
|
||||
while ($linkLine = fgets($linkLog)) {
|
||||
$statimg = "Down";
|
||||
$linkDate = " ";
|
||||
$protocol = " ";
|
||||
$linkType = " ";
|
||||
$linkRptr = " ";
|
||||
$linkRefl = " ";
|
||||
if(preg_match_all('/^(.{19}).*(D[A-Za-z]*).*Type: ([A-Za-z]*).*User: (.[^\s]+).*Dir: Incoming$/',$linkLine,$linx) > 0){
|
||||
$statimg = "Up";
|
||||
$linkDate = date("d-M-Y H:i:s", strtotime(substr($linx[1][0],0,19)));
|
||||
$protocol = $linx[2][0];
|
||||
$linkType = $linx[3][0];
|
||||
$linkRptr = $linx[4][0];
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
print "<tr>";
|
||||
print "<td>".str_replace(' ', ' ', substr($rptrcall,0,8))."</td>";
|
||||
print "<td> </td><td> </td><td> </td>";
|
||||
print "<td>$statimg</td>";
|
||||
print "<td>".str_replace(' ', ' ', substr($linkRptr,0,8))."</td>";
|
||||
print "<td>$protocol</td>";
|
||||
print "<td>Incoming</td>";
|
||||
$utc_time = $linkDate;
|
||||
$utc_tz = new DateTimeZone('UTC');
|
||||
$local_tz = new DateTimeZone(date_default_timezone_get ());
|
||||
$dt = new DateTime($utc_time, $utc_tz);
|
||||
$dt->setTimeZone($local_tz);
|
||||
$local_time = $dt->format('H:i:s M jS');
|
||||
print "<td>$local_time</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
fclose($linkLog);
|
||||
}
|
||||
// End
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code
|
||||
$configs = array();
|
||||
|
||||
if ($configfile = fopen($gatewayConfigPath,'r')) {
|
||||
while ($line = fgets($configfile)) {
|
||||
list($key,$value) = preg_split('/=/',$line);
|
||||
$value = trim(str_replace('"','',$value));
|
||||
if ($key != 'ircddbPassword' && strlen($value) > 0)
|
||||
$configs[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
$rev="20141101";
|
||||
$MYCALL=strtoupper($callsign);
|
||||
?>
|
||||
<b><?php echo $lang['active_starnet_groups'];?></b>
|
||||
<table style="table-layout: fixed;">
|
||||
<tr>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['callsign'];?><span><b>Starnet Callsign</b></span></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['logoff'];?><span><b>Starnet Logoff Callsign</b></span></a></th>
|
||||
<th colspan="3"><a class="tooltip" href="#"><?php echo $lang['info'];?><span><b>Infotext</b></span></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['utot'];?><span><b>User TimeOut (min)</b>inactivity time after which a user will be disconnected</span></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['gtot'];?><span><b>Group TimeOut (min)</b>inactivity time after which the group will be disconnected</span></a></th>
|
||||
</tr>
|
||||
<?php
|
||||
$ci = 0;
|
||||
$i = 0;
|
||||
$stngrp = array();
|
||||
for($i = 1;$i < 6; $i++){
|
||||
$param="starNetCallsign" . $i;
|
||||
if(isset($configs[$param])) {
|
||||
$gname = $configs[$param];
|
||||
$stngrp[$gname] = $i;
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
print "<tr>";
|
||||
print "<td align=\"center\">".str_replace(' ', ' ', substr($gname,0,8))."</td>";
|
||||
$param="starNetLogoff" . $i;
|
||||
if(isset($configs[$param])){ $output = str_replace(' ', ' ', substr($configs[$param],0,8)); print "<td align=\"center\">$output</td>";} else { print"<td> </td>";}
|
||||
$param="starNetInfo" . $i;
|
||||
if(isset($configs[$param])){ print "<td colspan=\"3\" align=\"left\">$configs[$param]</td>";} else { print"<td colspan=\"3\"> </td>";}
|
||||
$param="starNetUserTimeout" . $i;
|
||||
if(isset($configs[$param])){ print "<td align=\"center\">$configs[$param]</td>";} else { print"<td> </td>";}
|
||||
$param="starNetGroupTimeout" . $i;
|
||||
if(isset($configs[$param])){ print "<td align=\"center\">$configs[$param]</td>";} else { print"<td> </td>";}
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table><br />
|
||||
|
||||
<?php
|
||||
$groupsx = array();
|
||||
if ($starLog = fopen($starLogPath,'r')) {
|
||||
while($logLine = fgets($starLog)) {
|
||||
preg_match_all('/^(.{19}).*(Adding|Removing) (.{8}).*StarNet group (.{8}).*$/',$logLine,$matches);
|
||||
$groupz = substr($matches[4][0],0,8);
|
||||
$member = substr($matches[3][0],0,8);
|
||||
$action = substr($matches[2][0],0,8);
|
||||
$date = $matches[1][0];
|
||||
$guid = $stngrp[$groupz];
|
||||
if ($action == 'Adding'){
|
||||
$groupsx[$guid][$groupz][$member] = $date;
|
||||
}
|
||||
elseif ($action == 'Removing'){
|
||||
unset($groupsx[$guid][$groupz][$member]);
|
||||
}
|
||||
}
|
||||
fclose($starLog);
|
||||
}
|
||||
|
||||
//Clean the empty arrays from the multidimensional array
|
||||
$groupsx = array_map('array_filter', $groupsx);
|
||||
|
||||
$active = 0;
|
||||
for ($i = 1;$i < 6; $i++) {
|
||||
if (isset($groupsx[$i])) {
|
||||
$active = $active + count($groupsx[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($active >= 1) {
|
||||
|
||||
echo "<b>".$lang['active_starnet_members']."</b>\n";
|
||||
echo "<table style=\"table-layout: fixed;\">\n";
|
||||
echo "<tr>\n";
|
||||
echo "<th><a class=tooltip href=\"#\">".$lang['time']." (".date('T').")<span><b>Time of Login</b></span></a></th>\n";
|
||||
echo "<th><a class=tooltip href=\"#\">".$lang['group']."<span><b>Starnet Callsign</b></span></a></th>\n";
|
||||
echo "<th><a class=tooltip href=\"#\">".$lang['callsign']."<span><b>Callsign</b></span></a></th>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$ci = 0;
|
||||
$ulist = array();
|
||||
$glist = array();
|
||||
for($i = 1;$i < 6; $i++){
|
||||
if(isset($groupsx[$i])){
|
||||
$glist = $groupsx[$i];
|
||||
foreach ($glist as $gcall => $ulist){
|
||||
foreach ($ulist as $ucall => $ulogin){
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
$ulogin = date("d-M-Y H:i:s", strtotime(substr($ulogin,0,19)));
|
||||
$utc_time = $ulogin;
|
||||
$utc_tz = new DateTimeZone('UTC');
|
||||
$local_tz = new DateTimeZone(date_default_timezone_get ());
|
||||
$dt = new DateTime($utc_time, $utc_tz);
|
||||
$dt->setTimeZone($local_tz);
|
||||
$local_time = $dt->format('H:i:s M jS');
|
||||
$groupz = str_replace(' ', ' ', substr($gcall,0,8));
|
||||
$ucall = str_replace(' ', '', substr($ucall,0,8));
|
||||
print "<tr>";
|
||||
print "<td align=\"left\">$local_time</td>";
|
||||
print "<td align=\"center\">$groupz</td>";
|
||||
print "<td align=\"center\"><a href=\"http://www.qrz.com/db/$ucall\" target=\"_new\" alt=\"Lookup Callsign\">$ucall</a></td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</table>\n<br />\n";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
|
||||
$configs = array();
|
||||
|
||||
if ($configfile = fopen($gatewayConfigPath,'r')) {
|
||||
while ($line = fgets($configfile)) {
|
||||
list($key,$value) = preg_split('/=/',$line);
|
||||
$value = trim(str_replace('"','',$value));
|
||||
if ($key != 'ircddbPassword' && strlen($value) > 0)
|
||||
$configs[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
$rev="20141101";
|
||||
$MYCALL=strtoupper($callsign);
|
||||
?>
|
||||
<?php
|
||||
if (exec('grep "CCS link" '.$linkLogPath.' | wc -l') >=1) {
|
||||
?>
|
||||
<b>Active CCS Connections</b>
|
||||
<table>
|
||||
<tr>
|
||||
<th><a class=tooltip href="#">Repeater<span><b>Callsign of connected repeater</b></span></a></th>
|
||||
<th><a class=tooltip href="#">Linked to<span><b>Actual link status</b></span></a></th>
|
||||
<th><a class=tooltip href="#">Protocol<span><b>Protocol</b></span></a></th>
|
||||
<th><a class=tooltip href="#">Direction<span><b>Direction</b>incoming or outgoing</span></a></th>
|
||||
<th><a class=tooltip href="#">Last Change (<?php echo date('T')?>)<span><b>Timestamp of last change</b><?php echo date('T')?></span></a></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$ci = 0;
|
||||
if ($linkLog = fopen($linkLogPath,'r')) {
|
||||
$i=0;
|
||||
while ($linkLine = fgets($linkLog)) {
|
||||
// 2013-02-27 19:49:27: CCS link - Rptr: DB0LJ B Remote: DL5DI Dir: Incoming
|
||||
if(preg_match_all('/^(.{19}).*(C[A-Za-z]*).*Rptr: (.{8}).*Remote: (.{8}).*Dir: (.{8})$/',$linkLine,$linx) > 0){
|
||||
$utc_time = $linx[1][0];
|
||||
$utc_tz = new DateTimeZone('UTC');
|
||||
$local_tz = new DateTimeZone(date_default_timezone_get ());
|
||||
$dt = new DateTime($utc_time, $utc_tz);
|
||||
$dt->setTimeZone($local_tz);
|
||||
$local_time = $dt->format('H:i:s M jS');
|
||||
$linkDate = $local_time;
|
||||
$linkType = $linx[2][0];
|
||||
$linkRptr = $linx[3][0];
|
||||
$linkRem = $linx[4][0];
|
||||
$linkDir = $linx[5][0];
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
print "<tr>";
|
||||
print "<td>$linkRptr</td>";
|
||||
print "<td>$linkRem</td>";
|
||||
print "<td>CCS</td>";
|
||||
print "<td>$linkDir</td>";
|
||||
print "<td>$linkDate</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
fclose($linkLog);
|
||||
}
|
||||
|
||||
print "</table>\n<br />\n";
|
||||
}
|
||||
|
||||
$stn_is_set = 0;
|
||||
for($i = 1;$i < 6; $i++){
|
||||
$param="starNetCallsign" . $i;
|
||||
if(isset($configs[$param])) {
|
||||
$stn_is_set = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if($stn_is_set > 0){
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/dstarrepeater/active_starnet_groups.php';
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="settings-card">
|
||||
<table>
|
||||
<tr><th>ircDDB Network</th><th>APRS Host</th><th>CCS</th><th>DCS</th><th>DExtra</th><th>DPlus</th><th>D-Rats</th><th>Info</th><th>ircDDB</th><th>Echo</th><th>Log</th></tr>
|
||||
<tr>
|
||||
<td><?php print $configs['ircddbHostname']; ?></td>
|
||||
<td><?php if($configs['aprsEnabled'] == 1){ print $configs['aprsHostname']; } else { print "<img src=\"images/20red.png\">";} ?></td>
|
||||
<?php
|
||||
if($configs['ccsEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['dcsEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['dextraEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['dplusEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['dratsEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['infoEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['ircddbEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['echoEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
if($configs['logEnabled'] == 1){print "<td style=\"background-color:#1d1;\">ON</td>"; } else { print "<td style=\"background:#606060; color:#b0b0b0;\">OFF</td>"; }
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code
|
||||
$configs = array();
|
||||
|
||||
if ($configfile = fopen($gatewayConfigPath,'r')) {
|
||||
while ($line = fgets($configfile)) {
|
||||
list($key,$value) = preg_split('/=/',$line);
|
||||
$value = trim(str_replace('"','',$value));
|
||||
if ($key != 'ircddbPassword' && strlen($value) > 0)
|
||||
$configs[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
$rev="20141101";
|
||||
$MYCALL=strtoupper($callsign);
|
||||
|
||||
// Check if the config file exists
|
||||
if (file_exists('/etc/pistar-css.ini')) {
|
||||
// Use the values from the file
|
||||
$piStarCssFile = '/etc/pistar-css.ini';
|
||||
if (fopen($piStarCssFile,'r')) { $piStarCss = parse_ini_file($piStarCssFile, true); }
|
||||
|
||||
// Set the Values from the config file
|
||||
if (isset($piStarCss['Lookup']['Service'])) { $callsignLookupSvc = $piStarCss['Lookup']['Service']; } // Lookup Service "QRZ" or "RadioID"
|
||||
else { $callsignLookupSvc = "RadioID"; } // Set the default if its missing // Set the default if its missing
|
||||
} else {
|
||||
// Default values
|
||||
$callsignLookupSvc = "RadioID";
|
||||
}
|
||||
|
||||
// Safety net
|
||||
if (($callsignLookupSvc != "RadioID") && ($callsignLookupSvc != "QRZ")) { $callsignLookupSvc = "RadioID"; }
|
||||
|
||||
// Setup the URL(s)
|
||||
if ($callsignLookupSvc == "RadioID") { $callsignLookupUrl = "https://database.radioid.net/database/view?callsign="; }
|
||||
if ($callsignLookupSvc == "QRZ") { $callsignLookupUrl = "https://www.qrz.com/db/"; }
|
||||
|
||||
?>
|
||||
<b><?php echo $lang['last_heard_list'];?></b>
|
||||
<table>
|
||||
<tr>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['time'];?> (<?php echo date('T')?>)</a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['callsign'];?></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['target'];?></a></th>
|
||||
<th><a class="tooltip" href="#">RPT 1</a></th>
|
||||
<th><a class="tooltip" href="#">RPT 2</a></th>
|
||||
</tr>
|
||||
<?php
|
||||
// Headers.log sample:
|
||||
// 0000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122
|
||||
// 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
// 2012-06-05 12:18:41: DCS header - My: PU2ZHZ /T Your: CQCQCQ Rpt1: PU2ZHZ B Rpt2: DCS007 B Flags: 00 00 00
|
||||
// 2012-05-29 21:33:56: DPlus header - My: PD1RB /IC92 Your: CQCQCQ Rpt1: PE1RJV B Rpt2: REF017 A Flags: 00 00 00
|
||||
// 2013-02-09 13:49:57: DExtra header - My: DO7MT / Your: CQCQCQ Rpt1: XRF001 G Rpt2: XRF001 C Flags: 00 00 00
|
||||
//
|
||||
exec('(grep -v " /TIME" '.$hdrLogPath.'|sort -r -k7,7|sort -u -k7,8|sort -r|head -20 >/tmp/lastheard.log) 2>&1 &');
|
||||
$ci = 0;
|
||||
if ($LastHeardLog = fopen("/tmp/lastheard.log",'r')) {
|
||||
while ($linkLine = fgets($LastHeardLog)) {
|
||||
if(preg_match_all('/^(.{19}).*My: (.*).*Your: (.*).*Rpt1: (.*).*Rpt2: (.*).*Flags: (.*)$/',$linkLine,$linx) > 0){
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
print "<tr>";
|
||||
$QSODate = date("d-M-Y H:i:s", strtotime(substr($linx[1][0],0,19)));
|
||||
$MyCall = str_replace(' ', '', substr($linx[2][0],0,8));
|
||||
$MyCallLink = strtok(substr($linx[2][0],0,8), " ");
|
||||
$MyId = str_replace(' ', '', substr($linx[2][0],9,4));
|
||||
$YourCall = str_replace(' ', ' ', substr($linx[3][0],0,8));
|
||||
$Rpt1 = str_replace(' ', ' ', substr($linx[4][0],0,8));
|
||||
$Rpt2 = str_replace(' ', ' ', substr($linx[5][0],0,8));
|
||||
$utc_time = $QSODate;
|
||||
$utc_tz = new DateTimeZone('UTC');
|
||||
$local_tz = new DateTimeZone(date_default_timezone_get ());
|
||||
$dt = new DateTime($utc_time, $utc_tz);
|
||||
$dt->setTimeZone($local_tz);
|
||||
$local_time = $dt->format('H:i:s M jS');
|
||||
print "<td align=\"left\">$local_time</td>";
|
||||
print "<td align=\"left\" width=\"180\"><div style=\"float:left;\"><a href=\"".$callsignLookupUrl.$MyCallLink."\" target=\"_blank\">$MyCall</a>";
|
||||
if($MyId) { print "/".$MyId."</div> <div style=\"text-align:right;\">(<a href=\"https://aprs.fi/#!call=".$MyCallLink."*\" target=\"_blank\">dPRS</a>)</div></td>"; }
|
||||
else { print "</div> <div style=\"text-align:right;\">(<a href=\"https://aprs.fi/#!call=".$MyCallLink."*\" target=\"_blank\">dPRS</a>)</div></td>"; }
|
||||
print "<td align=\"left\" width=\"100\">$YourCall</td>";
|
||||
print "<td align=\"left\" width=\"100\">$Rpt1</td>";
|
||||
print "<td align=\"left\" width=\"100\">$Rpt2</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
fclose($LastHeardLog);
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
@@ -0,0 +1,205 @@
|
||||
<?php
|
||||
if ($_SERVER["PHP_SELF"] == "/admin/index.php") {
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code
|
||||
|
||||
if (!empty($_POST) && isset($_POST["dstrMgrSubmit"])):
|
||||
//if (!empty($_POST)):
|
||||
if (preg_match('/[^A-Z]/',$_POST["Link"])) { unset ($_POST["Link"]);}
|
||||
if ($_POST["Link"] == "LINK") {
|
||||
if (preg_match('/[^A-Za-z0-9 ]/',$_POST["RefName"])) { unset ($_POST["RefName"]);}
|
||||
if (preg_match('/[^A-Z]/',$_POST["Letter"])) { unset ($_POST["Letter"]);}
|
||||
if (preg_match('/[^A-Z0-9 ]/',$_POST["Module"])) { unset ($_POST["Module"]);}
|
||||
}
|
||||
if ($_POST["Link"] == "UNLINK") {
|
||||
if (preg_match('/[^A-Z0-9 ]/',$_POST["Module"])) { unset ($_POST["Module"]);}
|
||||
}
|
||||
|
||||
if (empty($_POST["RefName"]) || empty($_POST["Letter"]) || empty($_POST["Module"])) { echo "Somthing wrong with your input, try again";}
|
||||
|
||||
|
||||
else {
|
||||
if (strlen($_POST["RefName"]) != 7) {
|
||||
$targetRef = str_pad($_POST["RefName"], 7, " ");
|
||||
} else {
|
||||
$targetRef = $_POST["RefName"];
|
||||
}
|
||||
$targetRef = $targetRef.$_POST["Letter"];
|
||||
$targetRef = strtoupper($targetRef);
|
||||
$module = $_POST["Module"];
|
||||
|
||||
if (strlen($module) != 8) { //Fix the length of the module information
|
||||
$moduleFixedCs = strlen($module) - 1; //Length of the string, -1
|
||||
$moduleFixedBand = substr($module, -1); //Single Band Letter in the 8th position
|
||||
$moduleFixedCallPad = str_pad(substr($module, 0, $moduleFixedCs), 7); //Pad the callsign area to 7 chars
|
||||
$module = $moduleFixedCallPad.$moduleFixedBand; //Re add the band information
|
||||
};
|
||||
|
||||
$unlinkCommand = "sudo remotecontrold \"".$module."\" unlink";
|
||||
$linkCommand = "sudo remotecontrold \"".$module."\" link never \"".$targetRef."\"";
|
||||
|
||||
if ($module != $targetRef && $_POST["Link"] == "LINK") { // Sanity check that we are not connecting to ourself
|
||||
echo "<div class=\"settings-card\">\n<b>D-Star Link Manager</b>\n";
|
||||
echo "<table>\n<tr><th>Command Output</th></tr>\n<tr><td>";
|
||||
echo exec($linkCommand);
|
||||
echo "</td></tr>\n</table>\n</div>\n";
|
||||
}
|
||||
if ($module == $targetRef && $_POST["Link"] == "LINK") { // Sanity Check Failed
|
||||
echo "<div class=\"settings-card\">\n<b>D-Star Link Manager</b>\n";
|
||||
echo "<table>\n<tr><th>Command Output</th></tr>\n<tr><td>";
|
||||
echo "Cannot link to myself - Aborting link request!";
|
||||
echo "</td></tr>\n</table>\n</div>\n";
|
||||
}
|
||||
if ($_POST["Link"] == "UNLINK") { // Allow Unlink no matter what
|
||||
echo "<div class=\"settings-card\">\n<b>D-Star Link Manager</b>\n";
|
||||
echo "<table>\n<tr><th>Command Output</th></tr>\n<tr><td>";
|
||||
echo exec($unlinkCommand);
|
||||
echo "</td></tr>\n</table>\n</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
unset($_POST);
|
||||
echo '<script type="text/javascript">setTimeout(function() { window.location=window.location;},2000);</script>';
|
||||
|
||||
else: ?>
|
||||
<div class="settings-card">
|
||||
<b><?php echo $lang['d-star_link_manager'];?></b>
|
||||
<form action="//<?php echo htmlentities($_SERVER['HTTP_HOST']).htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<th width="150"><a class="tooltip" href="#">Radio Module<span><b>Radio Module</b></span></a></th>
|
||||
<th width="180"><a class="tooltip" href="#">Reflector<span><b>Reflector</b></span></a></th>
|
||||
<th width="150"><a class="tooltip" href="#">Link / Un-Link<span><b>Link / Un-Link</b></span></a></th>
|
||||
<th><a class="tooltip" href="#">Action<span><b>Action</b></span></a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<select name="Module">
|
||||
<?php
|
||||
$ci = 0;
|
||||
for($i = 1;$i < 5; $i++){
|
||||
$param="repeaterBand" . $i;
|
||||
if((isset($configs[$param])) && strlen($configs[$param]) == 1) {
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
$module = $configs[$param];
|
||||
$rcall = sprintf("%-7.7s%-1.1s",$MYCALL,$module);
|
||||
$param="repeaterCall" . $i;
|
||||
if(isset($configs[$param])) { $rptrcall=sprintf("%-7.7s%-1.1s",$configs[$param],$module); } else { $rptrcall = $rcall;}
|
||||
print "<option>$rptrcall</option>\n";
|
||||
}
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select name="RefName"
|
||||
onchange="if (this.options[this.selectedIndex].value == 'customOption') {
|
||||
toggleField(this,this.nextSibling);
|
||||
this.selectedIndex='0';
|
||||
} ">
|
||||
<?php
|
||||
$dcsFile = fopen("/usr/local/etc/DCS_Hosts.txt", "r");
|
||||
$dplusFile = fopen("/usr/local/etc/DPlus_Hosts.txt", "r");
|
||||
$dextraFile = fopen("/usr/local/etc/DExtra_Hosts.txt", "r");
|
||||
|
||||
echo " <option value=\"".substr($configs['reflector1'], 0, 6)."\" selected=\"selected\">".substr($configs['reflector1'], 0, 6)."</option>\n";
|
||||
echo " <option value=\"customOption\">Text Entry</option>\n";
|
||||
|
||||
while (!feof($dcsFile)) {
|
||||
$dcsLine = fgets($dcsFile);
|
||||
if (strpos($dcsLine, 'DCS') !== FALSE && strpos($dcsLine, '#') === FALSE) {
|
||||
echo " <option value=\"".substr($dcsLine, 0, 6)."\">".substr($dcsLine, 0, 6)."</option>\n";
|
||||
}
|
||||
if (strpos($dcsLine, 'XLX') !== FALSE && strpos($dcsLine, '#') === FALSE) {
|
||||
echo " <option value=\"".substr($dcsLine, 0, 6)."\">".substr($dcsLine, 0, 6)."</option>\n";
|
||||
}
|
||||
}
|
||||
fclose($dcsFile);
|
||||
|
||||
while (!feof($dplusFile)) {
|
||||
$dplusLine = fgets($dplusFile);
|
||||
if (strpos($dplusLine, 'REF') !== FALSE && strpos($dplusLine, '#') === FALSE) {
|
||||
echo " <option value=\"".substr($dplusLine, 0, 6)."\">".substr($dplusLine, 0, 6)."</option>\n";
|
||||
}
|
||||
if (strpos($dplusLine, 'XRF') !== FALSE && strpos($dplusLine, '#') === FALSE) {
|
||||
echo " <option value=\"".substr($dplusLine, 0, 6)."\">".substr($dplusLine, 0, 6)."</option>\n";
|
||||
}
|
||||
}
|
||||
fclose($dplusFile);
|
||||
|
||||
while (!feof($dextraFile)) {
|
||||
$dextraLine = fgets($dextraFile);
|
||||
if (strpos($dextraLine, 'XRF') !== FALSE && strpos($dextraLine, '#') === FALSE)
|
||||
echo " <option value=\"".substr($dextraLine, 0, 6)."\">".substr($dextraLine, 0, 6)."</option>\n";
|
||||
}
|
||||
fclose($dextraFile);
|
||||
|
||||
?>
|
||||
</select><input name="RefName" style="display:none;" disabled="disabled" type="text" size="7" maxlength="7"
|
||||
onblur="if(this.value==''){toggleField(this,this.previousSibling);}" />
|
||||
<select name="Letter">
|
||||
<?php echo " <option value=\"".substr($configs['reflector1'], 7)."\" selected=\"selected\">".substr($configs['reflector1'], 7)."</option>\n"; ?>
|
||||
<option>A</option>
|
||||
<option>B</option>
|
||||
<option>C</option>
|
||||
<option>D</option>
|
||||
<option>E</option>
|
||||
<option>F</option>
|
||||
<option>G</option>
|
||||
<option>H</option>
|
||||
<option>I</option>
|
||||
<option>J</option>
|
||||
<option>K</option>
|
||||
<option>L</option>
|
||||
<option>M</option>
|
||||
<option>N</option>
|
||||
<option>O</option>
|
||||
<option>P</option>
|
||||
<option>Q</option>
|
||||
<option>R</option>
|
||||
<option>S</option>
|
||||
<option>T</option>
|
||||
<option>U</option>
|
||||
<option>V</option>
|
||||
<option>W</option>
|
||||
<option>X</option>
|
||||
<option>Y</option>
|
||||
<option>Z</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="radio" name="Link" value="LINK" checked="checked" />Link
|
||||
<input type="radio" name="Link" value="UNLINK" />UnLink
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="dstrMgrSubmit" value="Request Change" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
exec ("pgrep pistar-keeper", $pids);
|
||||
if (!empty($pids))
|
||||
{
|
||||
echo "<br />\n";
|
||||
echo "<div class=\"settings-card\">\n";
|
||||
echo "<b>PiStar-Keeper Logbook</b><input type=button onClick=\"location.href='/admin/pistar-keeper-download.php'\" value=\"Download Logbook\">\n";
|
||||
echo "<table>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <th><a class=\"tooltip\" href=\"#\">PiStar-Keeper Log Entries (UTC)<span><b>PiStar-Keeper Log Entries (UTC)</b></span></th>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
exec ("tail -n 5 /var/pistar-keeper/pistar-keeper.log", $lines);
|
||||
$counter = 0;
|
||||
foreach ($lines as $line) {
|
||||
echo "<tr><td align=\"left\">".$lines[$counter]."</td></tr>\n";
|
||||
$counter++;
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code
|
||||
$configs = array();
|
||||
|
||||
if ($configfile = fopen($gatewayConfigPath,'r')) {
|
||||
while ($line = fgets($configfile)) {
|
||||
list($key,$value) = preg_split('/=/',$line);
|
||||
$value = trim(str_replace('"','',$value));
|
||||
if ($key != 'ircddbPassword' && strlen($value) > 0)
|
||||
$configs[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
$rev="20141101";
|
||||
$MYCALL=strtoupper($callsign);
|
||||
|
||||
// Check if the config file exists
|
||||
if (file_exists('/etc/pistar-css.ini')) {
|
||||
// Use the values from the file
|
||||
$piStarCssFile = '/etc/pistar-css.ini';
|
||||
if (fopen($piStarCssFile,'r')) { $piStarCss = parse_ini_file($piStarCssFile, true); }
|
||||
|
||||
// Set the Values from the config file
|
||||
if (isset($piStarCss['Lookup']['Service'])) { $callsignLookupSvc = $piStarCss['Lookup']['Service']; } // Lookup Service "QRZ" or "RadioID"
|
||||
else { $callsignLookupSvc = "RadioID"; } // Set the default if its missing // Set the default if its missing
|
||||
} else {
|
||||
// Default values
|
||||
$callsignLookupSvc = "RadioID";
|
||||
}
|
||||
|
||||
// Safety net
|
||||
if (($callsignLookupSvc != "RadioID") && ($callsignLookupSvc != "QRZ")) { $callsignLookupSvc = "RadioID"; }
|
||||
|
||||
// Setup the URL(s)
|
||||
if ($callsignLookupSvc == "RadioID") { $callsignLookupUrl = "https://database.radioid.net/database/view?callsign="; }
|
||||
if ($callsignLookupSvc == "QRZ") { $callsignLookupUrl = "https://www.qrz.com/db/"; }
|
||||
|
||||
?>
|
||||
<b><?php echo $lang['local_tx_list'];?></b>
|
||||
<table>
|
||||
<tr>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['time'];?> (<?php echo date('T')?>)</a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['callsign'];?></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['target'];?></a></th>
|
||||
<th><a class="tooltip" href="#">RPT 1</a></th>
|
||||
<th><a class="tooltip" href="#">RPT 2</a></th>
|
||||
</tr>
|
||||
<?php
|
||||
// Headers.log sample:
|
||||
// 0000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122
|
||||
// 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
||||
// 2012-05-29 20:31:53: Repeater header - My: PE1AGO /HANS Your: CQCQCQ Rpt1: PI1DEC B Rpt2: PI1DEC G Flags: 00 00 00
|
||||
//
|
||||
exec('(grep "Repeater header" '.$hdrLogPath.'|sort -r -k7,7|sort -u -k7,8|sort -r >/tmp/worked.log) 2>&1 &');
|
||||
$ci = 0;
|
||||
if ($WorkedLog = fopen("/tmp/worked.log",'r')) {
|
||||
while ($linkLine = fgets($WorkedLog)) {
|
||||
if(preg_match_all('/^(.{19}).*My: (.*).*Your: (.*).*Rpt1: (.*).*Rpt2: (.*).*Flags: (.*)$/',$linkLine,$linx) > 0){
|
||||
$ci++;
|
||||
if($ci > 1) { $ci = 0; }
|
||||
print "<tr>";
|
||||
$QSODate = date("d-M-Y H:i:s", strtotime(substr($linx[1][0],0,19)));
|
||||
$MyCall = str_replace(' ', '', substr($linx[2][0],0,8));
|
||||
$MyCallLink = strtok(substr($linx[2][0],0,8), " ");
|
||||
$MyId = str_replace(' ', '', substr($linx[2][0],9,4));
|
||||
$YourCall = str_replace(' ', ' ', substr($linx[3][0],0,8));
|
||||
$Rpt1 = str_replace(' ', ' ', substr($linx[4][0],0,8));
|
||||
$Rpt2 = str_replace(' ', ' ', substr($linx[5][0],0,8));
|
||||
$utc_time = $QSODate;
|
||||
$utc_tz = new DateTimeZone('UTC');
|
||||
$local_tz = new DateTimeZone(date_default_timezone_get ());
|
||||
$dt = new DateTime($utc_time, $utc_tz);
|
||||
$dt->setTimeZone($local_tz);
|
||||
$local_time = $dt->format('H:i:s M jS');
|
||||
print "<td align=\"left\">$local_time</td>";
|
||||
print "<td align=\"left\" width=\"180\"><div style=\"float:left;\"><a href=\"".$callsignLookupUrl.$MyCallLink."\" target=\"_blank\">$MyCall</a>";
|
||||
if($MyId) { print "/".$MyId."</div> <div style=\"text-align:right;\">(<a href=\"https://aprs.fi/#!call=".$MyCallLink."*\" target=\"_blank\">dPRS</a>)</div></td>"; }
|
||||
else { print "</div> <div style=\"text-align:right;\">(<a href=\"https://aprs.fi/#!call=".$MyCallLink."*\" target=\"_blank\">dPRS</a>)</div></td>"; }
|
||||
print "<td align=\"left\" width=\"100\">$YourCall</td>";
|
||||
print "<td align=\"left\" width=\"100\">$Rpt1</td>";
|
||||
print "<td align=\"left\" width=\"100\">$Rpt2</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
fclose($WorkedLog);
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/mmdvmhost/tools.php';
|
||||
$configs = array();
|
||||
|
||||
if ($configfile = fopen($gatewayConfigPath,'r')) {
|
||||
while ($line = fgets($configfile)) {
|
||||
list($key,$value) = preg_split('/=/',$line);
|
||||
$value = trim(str_replace('"','',$value));
|
||||
if ($key != 'ircddbPassword' && strlen($value) > 0)
|
||||
$configs[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
|
||||
$rev="20141101";
|
||||
$MYCALL=strtoupper($callsign);
|
||||
?>
|
||||
<?php
|
||||
$cpuLoad = sys_getloadavg();
|
||||
$cpuTempCRaw = floatval(exec('cat /sys/class/thermal/thermal_zone0/temp'));
|
||||
if ($cpuTempCRaw > 1000) { $cpuTempC = round($cpuTempCRaw / 1000, 1); } else { $cpuTempC = round($cpuTempCRaw, 1); }
|
||||
$cpuTempF = round(+$cpuTempC * 9 / 5 + 32, 1);
|
||||
if ($cpuTempC < 50) { $cpuTempHTML = "<td style=\"background: #1d1\">".$cpuTempC."°C / ".$cpuTempF."°F</td>\n"; }
|
||||
if ($cpuTempC >= 50) { $cpuTempHTML = "<td style=\"background: #fa0\">".$cpuTempC."°C / ".$cpuTempF."°F</td>\n"; }
|
||||
if ($cpuTempC >= 69) { $cpuTempHTML = "<td style=\"background: #f00\">".$cpuTempC."°C / ".$cpuTempF."°F</td>\n"; }
|
||||
?>
|
||||
<b><?php echo $lang['hardware_info'];?></b>
|
||||
<table style="table-layout: fixed;">
|
||||
<tr>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['hostname'];?><br /><span><b>System IP Address:<br /><?php echo str_replace(',', ',<br />', exec('hostname -I'));?></b></span></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['kernel'];?><span><b>Release</b></span></a></th>
|
||||
<th colspan="2"><a class="tooltip" href="#"><?php echo $lang['platform'];?><span><b>Uptime:<br /><?php echo str_replace(',', ',<br />', exec('uptime -p'));?></b></span></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['cpu_load'];?><span><b>CPU Load</b></span></a></th>
|
||||
<th><a class="tooltip" href="#"><?php echo $lang['cpu_temp'];?><span><b>CPU Temp</b></span></a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php if (strlen(php_uname('n')) >= 16) { echo substr(php_uname('n'), 0, 14) . '..'; } else { echo php_uname('n'); } ?></td>
|
||||
<td><?php echo php_uname('r');?></td>
|
||||
<td colspan="2"><?php echo exec('/usr/local/bin/platformDetect.sh');?></td>
|
||||
<td><?php echo number_format($cpuLoad[0],2);?> / <?php echo number_format($cpuLoad[1],2);?> / <?php echo number_format($cpuLoad[2],2);?></td>
|
||||
<?php echo $cpuTempHTML; ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="6"><?php echo $lang['service_status'];?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background: #<?php if (isProcessRunning('MMDVMHost')) { echo "1d1"; } else { echo "b55"; } ?>">MMDVMHost</td>
|
||||
<td style="background: #<?php if (isProcessRunning('dstarrepeaterd')) { echo "1d1"; } else { echo "b55"; } ?>">DStarRepeater</td>
|
||||
<td style="background: #<?php if (isProcessRunning('ircddbgatewayd')) { echo "1d1"; } else { echo "b55"; } ?>">ircDDBGateway</td>
|
||||
<td style="background: #<?php if (isProcessRunning('timeserverd')) { echo "1d1"; } else { echo "b55"; } ?>">TimeServer</td>
|
||||
<td style="background: #<?php if (isProcessRunning('/usr/local/sbin/pistar-watchdog',true)) { echo "1d1"; } else { echo "b55"; } ?>">PiStar-Watchdog</td>
|
||||
<td style="background: #<?php if (isProcessRunning('/usr/local/sbin/pistar-remote',true)) { echo "1d1"; } else { echo "b55"; } ?>">PiStar-Remote</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
Reference in New Issue
Block a user