2020-05-21 16:44:20 +02:00
|
|
|
<?php
|
|
|
|
$title = "Update";
|
|
|
|
require_once("includes/config.php");
|
|
|
|
require_once("includes/header.php");
|
|
|
|
require_once("includes/nav.php");
|
|
|
|
|
2020-09-13 23:59:49 +02:00
|
|
|
if ($_SERVER['REQUEST_METHOD'] === POST && isset($_FILES['update']) && $_FILES['update']['size'] > 10000000 && $_FILES['upfile']['size'] < 10000000 && isset($_POST['password']) && !empty($_POST['password'])) {
|
2020-09-24 01:02:27 +02:00
|
|
|
move_uploaded_file($_FILES['file']['tmp_name'], '/tmp/update.tar.cc');
|
|
|
|
exec("/bin/chmod 777 /tmp/update.tar.cc");
|
|
|
|
exec("key='".escapeshellarg($_POST['password'])."' /bin/sh -c '/usr/bin/sudo /bin/sh /update.sh'", $result);
|
2020-05-21 16:44:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div class="container">
|
|
|
|
<h2>System Update</h2>
|
|
|
|
<form id="update" enctype="multipart/form-data" method="post" action="">
|
|
|
|
<fieldset>
|
2020-09-13 23:59:49 +02:00
|
|
|
<input type="file" name="update" required>
|
|
|
|
<input type="password" name="password" placeholder="Update password" required>
|
2020-05-21 16:44:20 +02:00
|
|
|
<input type="submit" class="btn btn-b btn-sm smooth" value="Upload">
|
|
|
|
<p>
|
|
|
|
<ul>
|
2020-09-24 01:02:27 +02:00
|
|
|
<li>Please select the file <i>update.tar.cc</i></li>
|
2020-05-21 16:44:20 +02:00
|
|
|
<li>The update will take about 2 minutes</li>
|
|
|
|
<li>Updates are cryptographically signed for integrity and authenticity</li>
|
|
|
|
</ul>
|
|
|
|
</p>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|