Better (???) update procedure.

This commit is contained in:
Pecusx
2016-10-31 18:57:22 +01:00
committed by GitHub
parent 5c6db5193d
commit af0c99e09b
2 changed files with 16 additions and 4 deletions
+15 -4
View File
@@ -11,13 +11,24 @@
<hr>
Update to last build from github<br><pre>
<?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">
<?php if (is_numeric($github_version_date)) { ?>
<button type="submit" name="submit" value="yes">Yes - update and reboot</button>
<?php } ?>
<button type="submit" name="submit" value="no">No - no update</button>
<hr>
</body>