Files
cdn-star/admin/expert/ssh_access.php
T
2026-07-19 18:27:27 +08:00

63 lines
2.6 KiB
PHP

<?php
// Load the language support
require_once('../config/language.php');
// Load the Pi-Star Release file
$pistarReleaseConfig = '/etc/pistar-release';
$configPistarRelease = array();
$configPistarRelease = parse_ini_file($pistarReleaseConfig, true);
// Load the Version Info
require_once('../config/version.php');
if (file_exists('/etc/default/shellinabox')) {
$getPortCommand = "grep -m 1 'SHELLINABOX_PORT=' /etc/default/shellinabox | awk -F '=' '/SHELLINABOX_PORT=/ {print $2}'";
$shellPort = exec($getPortCommand);
}
// Sanity Check that this file has been opened correctly
if ($_SERVER["PHP_SELF"] == "/admin/expert/ssh_access.php") {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" lang="en">
<head>
<meta name="robots" content="index" />
<meta name="robots" content="follow" />
<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="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>CDN - <?php echo $lang['digital_voice']." ".$lang['dashboard']." - SSH";?></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>
</head>
<body>
<div class="container">
<?php include './header-menu.inc'; ?>
<div class="contentwide">
<h2>SSH - CDN</h2>
<div class="settings-card" style="padding-top:16px;">
<div id="tail">
<?php if (isset($shellPort)) {
echo "<iframe src=\"http://".$_SERVER['HTTP_HOST'].":".$shellPort."\" style=\"border:0px #ffffff none; background:#ffffff; color:#00ff00;\" name=\"CDN_SSH\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"100%\" width=\"100%\"></iframe>";
}
else {
echo "SSH Feature not yet installed";
} ?>
</div>
<?php if (isset($shellPort)) { echo "<div class=\"field-actions\"><a href=\"//".$_SERVER['HTTP_HOST'].":".$shellPort."\">Open fullscreen SSH client</a></div>\n"; } ?>
</div>
</div>
</div>
</body>
</html>
<?php
}
?>