added php logic

master
Jan Danielzick 2020-02-12 05:26:21 +01:00
parent 871bf8cf4a
commit b25ef05312
1 changed files with 26 additions and 2 deletions

View File

@ -17,9 +17,33 @@ echo "Done.";
--> -->
<html> <html>
<head> <head>
<title> Strassenkind Status Page </title> <title> Strassenkind Server Status Page </title>
<link rel="stylesheet" type="text/css" href="./common/content/style.css" /> <link rel="stylesheet" type="text/css" href="./common/content/style.css" />
<?php
if (!isset($_POST['ondemand'])) {
echo "<meta http-equiv=\"refresh\" content=\"20\" />";
}
?>
</head> </head>
<body> <body class="status_page">
<h1> Strassenkind Server Status </h1>
<hr />
<?php
// run ondemand command list if demanded
if (isset($_POST['ondemand'])) {
foreach ($ondemand_commands as $command) {
echo "<!-- $command\n";
$output = system($command);
echo "-->\n<pre class=\"commandLine\"> $command </pre>\n<pre class=\"commandLine\"> $output </pre>\n<hr />";
}
} else {
//run status command list otherwise
foreach ($status_commands as $command) {
echo "<!-- $command\n";
$output = system($command);
echo "-->\n<pre class=\"commandLine\"> $command </pre>\n<pre class=\"commandLine\"> $output </pre>\n<hr />";
}
}
?>
</body> </body>
</html> </html>