mirror of
https://github.com/pkali/piradio-mini.git
synced 2026-05-20 22:34:22 +02:00
Better (???) update procedure.
This commit is contained in:
@@ -54,6 +54,7 @@ if (isset($msg)) {
|
|||||||
echo "</script>\r\n";
|
echo "</script>\r\n";
|
||||||
} else {
|
} else {
|
||||||
echo "Update from github canceled.<br>\r\n";
|
echo "Update from github canceled.<br>\r\n";
|
||||||
|
$end = shell_exec('sudo ./scripts/cancel_update.sh');
|
||||||
echo "<script>\r\n";
|
echo "<script>\r\n";
|
||||||
echo "// redirect to main after 2 seconds\r\n";
|
echo "// redirect to main after 2 seconds\r\n";
|
||||||
echo "window.setTimeout(function() {\r\n";
|
echo "window.setTimeout(function() {\r\n";
|
||||||
|
|||||||
+15
-4
@@ -11,13 +11,24 @@
|
|||||||
<hr>
|
<hr>
|
||||||
Update to last build from github<br><pre>
|
Update to last build from github<br><pre>
|
||||||
<?php
|
<?php
|
||||||
echo "Your PiRadio version: <b>5.4c</b>. Last commit: <b>".date("F d Y H:i:s",filemtime("/usr/share/radio/README.md"))."</b>.";
|
$end = shell_exec('sudo ./scripts/github_download.sh');
|
||||||
|
$local_version_date = filemtime("/usr/share/radio/README.md");
|
||||||
|
$local_version = str_replace("\n","",file_get_contents( "/usr/share/radio/version" ));
|
||||||
|
$github_version_date = filemtime("/usr/share/piradio-mini-master/README.md");
|
||||||
|
$github_version = str_replace("\n","",file_get_contents( "/usr/share/piradio-mini-master/version" ));
|
||||||
|
echo "Your PiRadio version: <b>".$local_version."</b>. Last commit: <b>".date("d.m.Y H:i:s",$local_version_date)."</b>.<br>";
|
||||||
|
if (is_numeric($github_version_date)) {
|
||||||
|
echo "GitHub PiRadio version: <b>".$github_version."</b>. Last commit: <b>".date("d.m.Y H:i:s",$github_version_date)."</b>.";
|
||||||
|
echo "<br><br>Do you really want to update your PiRadio from github repository.<br>";
|
||||||
|
echo "<br>After update your PiRadio will be rebooted!</pre>";
|
||||||
|
} else {
|
||||||
|
echo "<b>Problem with download update files from GitHub!!!</b>.</pre>";
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<br>Do you really want to update your PiRadio from github repository.<br>
|
|
||||||
After update your PiRadio will be rebooted!</pre>
|
|
||||||
<form action="changeconf.php?file=update" method="post">
|
<form action="changeconf.php?file=update" method="post">
|
||||||
|
<?php if (is_numeric($github_version_date)) { ?>
|
||||||
<button type="submit" name="submit" value="yes">Yes - update and reboot</button>
|
<button type="submit" name="submit" value="yes">Yes - update and reboot</button>
|
||||||
|
<?php } ?>
|
||||||
<button type="submit" name="submit" value="no">No - no update</button>
|
<button type="submit" name="submit" value="no">No - no update</button>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user