1000) { $cpuTempC = round($cpuTempCRaw / 1000, 1); } else { $cpuTempC = round($cpuTempCRaw, 1); }
$cpuTempF = round(+$cpuTempC * 9 / 5 + 32, 1);
if ($cpuTempC < 50) { $cpuTempHTML = "
".$cpuTempC."°C / ".$cpuTempF."°F | \n"; }
if ($cpuTempC >= 50) { $cpuTempHTML = "".$cpuTempC."°C / ".$cpuTempF."°F | \n"; }
if ($cpuTempC >= 69) { $cpuTempHTML = "".$cpuTempC."°C / ".$cpuTempF."°F | \n"; }
// Pull in some config
require_once('config/version.php');
require_once('config/ircddblocal.php');
require_once('config/language.php');
$cpuLoad = sys_getloadavg();
// Load the pistar-release file
$pistarReleaseConfig = '/etc/pistar-release';
$configPistarRelease = parse_ini_file($pistarReleaseConfig, true);
// Load the dstarrepeater config file
$configdstar = array();
if ($configdstarfile = fopen('/etc/dstarrepeater','r')) {
while ($line1 = fgets($configdstarfile)) {
if (strpos($line1, '=') !== false) {
list($key1,$value1) = preg_split('/=/',$line1);
$value1 = trim(str_replace('"','',$value1));
if (strlen($value1) > 0)
$configdstar[$key1] = $value1;
}
}
fclose($configdstarfile);
}
// Load the ircDDBGateway config file
$configs = array();
if ($configfile = fopen($gatewayConfigPath,'r')) {
while ($line = fgets($configfile)) {
if (strpos($line, '=') !== false) {
list($key,$value) = preg_split('/=/',$line);
$value = trim(str_replace('"','',$value));
if ($key != 'ircddbPassword' && strlen($value) > 0)
$configs[$key] = $value;
}
}
fclose($configfile);
}
// Load the mmdvmhost config file
$mmdvmConfigFile = '/etc/mmdvmhost';
$configmmdvm = parse_ini_file($mmdvmConfigFile, true);
// Load the ysfgateway config file
$ysfgatewayConfigFile = '/etc/ysfgateway';
$configysfgateway = parse_ini_file($ysfgatewayConfigFile, true);
// Load the ysf2dmr config file
if (file_exists('/etc/ysf2dmr')) {
$ysf2dmrConfigFile = '/etc/ysf2dmr';
if (fopen($ysf2dmrConfigFile,'r')) { $configysf2dmr = parse_ini_file($ysf2dmrConfigFile, true); }
}
// Load the ysf2nxdn config file
if (file_exists('/etc/ysf2nxdn')) {
$ysf2nxdnConfigFile = '/etc/ysf2nxdn';
if (fopen($ysf2nxdnConfigFile,'r')) { $configysf2nxdn = parse_ini_file($ysf2nxdnConfigFile, true); }
}
// Load the ysf2p25 config file
if (file_exists('/etc/ysf2p25')) {
$ysf2p25ConfigFile = '/etc/ysf2p25';
if (fopen($ysf2p25ConfigFile,'r')) { $configysf2p25 = parse_ini_file($ysf2p25ConfigFile, true); }
}
// Load the dgidgateway config file
if (file_exists('/etc/dgidgateway')) {
$dgidgatewayConfigFile = '/etc/dgidgateway';
if (fopen($dgidgatewayConfigFile,'r')) { $configdgidgateway = parse_ini_file($dgidgatewayConfigFile, true); }
}
// Load the dmr2ysf config file
if (file_exists('/etc/dmr2ysf')) {
$dmr2ysfConfigFile = '/etc/dmr2ysf';
if (fopen($dmr2ysfConfigFile,'r')) { $configdmr2ysf = parse_ini_file($dmr2ysfConfigFile, true); }
}
// Load the dmr2nxdn config file
if (file_exists('/etc/dmr2nxdn')) {
$dmr2nxdnConfigFile = '/etc/dmr2nxdn';
if (fopen($dmr2nxdnConfigFile,'r')) { $configdmr2nxdn = parse_ini_file($dmr2nxdnConfigFile, true); }
}
// Load the p25gateway config file
if (file_exists('/etc/p25gateway')) {
$p25gatewayConfigFile = '/etc/p25gateway';
if (fopen($p25gatewayConfigFile,'r')) { $configp25gateway = parse_ini_file($p25gatewayConfigFile, true); }
}
// Load the nxdngateway config file
if (file_exists('/etc/nxdngateway')) {
$nxdngatewayConfigFile = '/etc/nxdngateway';
if (fopen($nxdngatewayConfigFile,'r')) { $confignxdngateway = parse_ini_file($nxdngatewayConfigFile, true); }
}
// Load the m17gateway config file
if (file_exists('/etc/m17gateway')) {
$m17gatewayConfigFile = '/etc/m17gateway';
if (fopen($m17gatewayConfigFile,'r')) { $configm17gateway = parse_ini_file($m17gatewayConfigFile, true); }
}
// Load the nxdn2dmr config file
if (file_exists('/etc/nxdn2dmr')) {
$nxdn2dmrConfigFile = '/etc/nxdn2dmr';
if (fopen($nxdn2dmrConfigFile,'r')) { $confignxdn2dmr = parse_ini_file($nxdn2dmrConfigFile, true); }
}
// DAPNet Gateway config
if (file_exists('/etc/dapnetgateway')) {
$configDAPNetConfigFile = '/etc/dapnetgateway';
if (fopen($configDAPNetConfigFile,'r')) { $configdapnetgw = parse_ini_file($configDAPNetConfigFile, true); }
}
// APRS Gateway config
if (file_exists('/etc/aprsgateway')) {
$configAPRSconfigFile = '/etc/aprsgateway';
if (fopen($configAPRSconfigFile,'r')) { $configaprsgw = parse_ini_file($configAPRSconfigFile, true); }
}
// Load the dmrgateway config file
$dmrGatewayConfigFile = '/etc/dmrgateway';
if (fopen($dmrGatewayConfigFile,'r')) { $configdmrgateway = parse_ini_file($dmrGatewayConfigFile, true); }
// Load the modem config information
if (file_exists('/etc/dstar-radio.dstarrepeater')) {
$modemConfigFileDStarRepeater = '/etc/dstar-radio.dstarrepeater';
if (fopen($modemConfigFileDStarRepeater,'r')) { $configModem = parse_ini_file($modemConfigFileDStarRepeater, true); }
}
if (file_exists('/etc/dstar-radio.mmdvmhost')) {
$modemConfigFileMMDVMHost = '/etc/dstar-radio.mmdvmhost';
if (fopen($modemConfigFileMMDVMHost,'r')) { $configModem = parse_ini_file($modemConfigFileMMDVMHost, true); }
}
function aprspass ($callsign) {
$stophere = strpos($callsign, '-');
if ($stophere) $callsign = substr($callsign, 0, $stophere);
$realcall = strtoupper(substr($callsign, 0, 10));
// initialize hash
$hash = 0x73e2;
$i = 0;
$len = strlen($realcall);
// hash callsign two bytes at a time
while ($i < $len) {
$hash ^= ord(substr($realcall, $i, 1))<<8;
$hash ^= ord(substr($realcall, $i + 1, 1));
$i += 2;
}
// mask off the high bit so number is always positive
return $hash & 0x7fff;
}
$progname = basename($_SERVER['SCRIPT_FILENAME'],".php");
$rev=$version;
$MYCALL=strtoupper($configs['gatewayCallsign']);
?>
\n"; ?>
= 7 ) && (!isset($configmmdvm['DMR']['WhiteList'])) ) {
?>
| Alert: You are running a hotspot in public mode without an access list for DMR, this setup *could* participate in network loops! |
\n";
echo "
\n";
echo "| 处理中… |
\n";
echo "| 正在应用配置更改… |
\n";
echo "
\n";
echo "
\n";
echo '';
echo "
\n
\n";
echo "\n\n\n";
die();
}
// AutoAP PSK Change
if (empty($_POST['autoapPsk']) != TRUE ) {
$rollAutoApPsk = 'sudo sed -i "/wpa_passphrase=/c\\wpa_passphrase='.$_POST['autoapPsk'].'" /etc/hostapd/hostapd.conf';
system($rollAutoApPsk);
$rollAutoApWPA = 'sudo sed -i "/wpa=/c\\wpa=2" /etc/hostapd/hostapd.conf';
system($rollAutoApWPA);
unset($_POST);
echo "\n";
echo "
\n";
echo "| 处理中… |
\n";
echo "| 正在应用配置更改… |
\n";
echo "
\n";
echo "
\n";
echo '';
echo "
\n\n";
echo "\n