Skip to content

Commit

Permalink
Merge pull request #29 from fabianh001/master
Browse files Browse the repository at this point in the history
Added support for a remote shutdown
  • Loading branch information
tillepille authored Jul 4, 2018
2 parents f5732a5 + d10dac5 commit 879d5f2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webinterface/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* don't forget to edit config.php
*/
include("config.php");
include("shutdown.php");

/*
* get parameters
Expand Down Expand Up @@ -137,5 +138,6 @@
}
echo "</TR></TABLE>";
?>
<a id="shutdown" href='shutdown.php?shutdown=true'>Shutdown System</a>
</body>
</html>
9 changes: 9 additions & 0 deletions webinterface/shutdown.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
function runShutdown(){
exec("/sbin/shutdown -h now");
}

if (isset($_GET['shutdown'])) {
runShutdown();
}
?>
7 changes: 7 additions & 0 deletions webinterface/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ p {
text-align: center;
}

#shutdown {
margin-top: 50px;
bottom: 0;
right: 10;
position: absolute;
}

/* Android HDPI */
@media only screen and (-webkit-device-pixel-ratio:1.5) {
td.outer {
Expand Down

0 comments on commit 879d5f2

Please sign in to comment.